summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authordetiam2023-08-01 02:47:39 +0800
committerdetiam2023-08-01 02:47:39 +0800
commitf6f1cc07d949b7de558175a763029ab78f06be2c (patch)
tree0d9e5500980a2ff1d213a8383b2276b28aa3ca6a
parent26eb6863d0b24a7bfb12708f3b5860d810c580dd (diff)
downloadaur-f6f1cc07d949b7de558175a763029ab78f06be2c.tar.gz
Format PKGBUILD
-rw-r--r--PKGBUILD97
1 files changed, 48 insertions, 49 deletions
diff --git a/PKGBUILD b/PKGBUILD
index be7bc0225ea4..15fab7c6defa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,8 +2,7 @@
# Contributor: Jakob Kreuze <jakob@memeware.net>
# Contributor: Bader <Bad3r@unsigned.sh>
-# shellcheck disable=SC1090
-# shellcheck disable=SC2206
+# shellcheck disable=SC1090,SC2206
pkgname=pince-git
pkgver=r1312.edaf531
pkgrel=1
@@ -19,60 +18,60 @@ _installpath='/usr/share/PINCE'
_installsh='install_pince.sh'
pkgver() {
- cd "$pkgname"
- printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ cd "$pkgname"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
- # Remove ".venv/PINCE" exist check
- sed -i '/^if \[ ! -d "\.venv\/PINCE" \]; /,/activate$/ s/^/# /' "./$pkgname/PINCE.sh"
- # Create a simple start script
- cat >pince<< \
-EOF
-pushd $_installpath
-sh PINCE.sh "$@"
-popd
-EOF
+ # Remove ".venv/PINCE" exist check
+ sed -i '/^if \[ ! -d "\.venv\/PINCE" \]; /,/activate$/ s/^/# /' "./$pkgname/PINCE.sh"
+ # Create a simple start script
+ cat > pince <<- SHELL
+ #!/bin/bash
+ pushd "$_installpath" || exit
+ sh PINCE.sh "\$@"
+ popd || exit
+ SHELL
}
build() {
- cd "$pkgname"
- # Source functions
- . <(sed -n '/^exit_on_error() /,/^}/p' $_installsh)
- . <(sed -n '/^set_install_vars() /,/^}/p' $_installsh)
- . <(sed -n '/^compile_translations() /,/^}/p' $_installsh)
- . <(sed -n '/^compile_scanmem() /,/^}/p' $_installsh)
- . <(sed -n '/^install_scanmem() /,/^}/p' $_installsh)
- # Execute functions
- set_install_vars "$(lsb_release -ds)" || exit_on_error
- install_scanmem || exit_on_error
- compile_translations || exit_on_error
+ cd "$pkgname"
+ # Source functions
+ . <(sed -n '/^exit_on_error() /,/^}/p' $_installsh)
+ . <(sed -n '/^set_install_vars() /,/^}/p' $_installsh)
+ . <(sed -n '/^compile_translations() /,/^}/p' $_installsh)
+ . <(sed -n '/^compile_scanmem() /,/^}/p' $_installsh)
+ . <(sed -n '/^install_scanmem() /,/^}/p' $_installsh)
+ # Execute functions
+ set_install_vars "$(lsb_release -ds)" || exit_on_error
+ install_scanmem || exit_on_error
+ compile_translations || exit_on_error
}
package() {
- cd "$pkgname"
- # Source PKG_NAMES* vars
- . <(sed -n '/^PKG_NAMES/p' $_installsh)
- # Set new depends
- depends+=($PKG_NAMES_ARCH)
- for pipkg in $PKG_NAMES_PIP; do
- ## why archlinux python package isn't just match "python-$pipkg" format?
- if [ "$pipkg" == "distorm3" ]; then
- depends+=("python-distorm")
- elif [ "$pipkg" == "pygobject" ]; then
- depends+=("python-gobject")
- elif [ "$pipkg" == "keystone-engine" ]; then
- depends+=("python-keystone")
- else
- depends+=("python-$pipkg")
- fi
- done
- # Copy files
- install -d "$pkgdir/usr/bin"
- install -Dm755 ../pince "$pkgdir/usr/bin"
- install -d "$pkgdir/$_installpath/i18n"
- install PINCE.sh PINCE.py \
- COPYING COPYING.CC-BY AUTHORS THANKS "$pkgdir/$_installpath"
- cp -r GUI libpince media tr "$pkgdir/$_installpath"
- cp -r i18n/qm "$pkgdir/$_installpath/i18n"
+ cd "$pkgname"
+ # Source PKG_NAMES* vars
+ . <(sed -n '/^PKG_NAMES/p' $_installsh)
+ # Set new depends
+ depends+=($PKG_NAMES_ARCH)
+ for pipkg in $PKG_NAMES_PIP; do
+ ## why archlinux python package isn't just match "python-$pipkg" format?
+ if [ "$pipkg" == "distorm3" ]; then
+ depends+=("python-distorm")
+ elif [ "$pipkg" == "pygobject" ]; then
+ depends+=("python-gobject")
+ elif [ "$pipkg" == "keystone-engine" ]; then
+ depends+=("python-keystone")
+ else
+ depends+=("python-$pipkg")
+ fi
+ done
+ # Copy files
+ install -d "$pkgdir/usr/bin"
+ install -Dm755 ../pince "$pkgdir/usr/bin"
+ install -d "$pkgdir/$_installpath/i18n"
+ install PINCE.sh PINCE.py \
+ COPYING COPYING.CC-BY AUTHORS THANKS "$pkgdir/$_installpath"
+ cp -r GUI libpince media tr "$pkgdir/$_installpath"
+ cp -r i18n/qm "$pkgdir/$_installpath/i18n"
}