[PATCH v2] add package generation for arch linux
Export this patch
tidy up package generation script and correct a few errors
---
genscripts/gen_alpinepackage.sh | 5 ++--
genscripts/gen_archpackage.sh | 51 +++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 2 deletions(-)
create mode 100755 genscripts/gen_archpackage.sh
diff --git a/genscripts/gen_alpinepackage.sh b/genscripts/gen_alpinepackage.sh
index 5d3e6c1..6deef21 100755
--- a/genscripts/gen_alpinepackage.sh
+++ b/genscripts/gen_alpinepackage.sh
@@ -7,6 +7,7 @@ header() {
echo '
# Maintainer: Miles Alan <m@milesalan.com>
# Contributor: Miles Alan <m@milesalan.com>
+# Contributor: Bobby Hamblin <hamblingreen@hotmail.com>
pkgname=f_scripts
pkgver='$(git tag | tail -n1)'
pkgrel=0
@@ -34,13 +35,13 @@ package() {
gen() {
for FILE in ../scripts/f_*; do
- unset DEP DEC
+ unset DEP_ALPINE DEC
. "$FILE" nonexistentfn 2>/dev/null
SCRIPTNAME="$(basename "$FILE")"
echo ''${SCRIPTNAME}'() {
pkgdesc="$pkgname - '$SCRIPTNAME' script, '$DEC'"
- depends="$depends '$DEP'"
+ depends="$depends '$DEP_ALPINE'"
install -Dm755 "$builddir"/scripts/'$SCRIPTNAME' "$subpkgdir/usr/bin/'$SCRIPTNAME'"
}
'
diff --git a/genscripts/gen_archpackage.sh b/genscripts/gen_archpackage.sh
new file mode 100755
index 0000000..61bc486
--- /dev/null
+++ b/genscripts/gen_archpackage.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env osh
+# This is basically a script that generates a PKGBUILD for
+# f_scripts with each subpackage. So this is a metaprogramming script
+# that generates another script..
+
+# Make sure to run `makepkg --nobuild` to grab, extract, and patch
+# sources.
+
+header() {
+ echo '# Maintainer: Miles Alan <m@milesalan.com>
+# Contributor: Bobby Hamblin <hamblingreen@hotmail.com>
+
+pkgbase=f_scripts
+pkgname=('"'"'f_audio'"'"' '"'"'f_files'"'"' '"'"'f_game'"'"' '"'"'f_maps'"'"' '"'"'f_networks'"'"' '"'"'f_phone'"'"' '"'"'f_rss'"'"' '"'"'f_theme'"'"' '"'"'f_timer'"'"' '"'"'f_web'"'"' '"'"'f_youtube'"'"')
+pkgver='$(git tag | tail -n1)'
+pkgrel=1
+pkgdesc="Framebufferphone prompt-driven scripts which are compatible with fbp"
+url="http://git.sr.ht/~mil/f_scripts"
+arch=('"'"'any'"'"')
+license=('"'"'GPL-3.0-or-later'"'"')
+depends=('"'"'oil'"'"')
+source=("https://git.sr.ht/~mil/f_scripts/archive/$pkgver.tar.gz")
+sha256sums=('"'"'SKIP'"'"')
+'
+}
+
+gen() {
+ for FILE in ../scripts/f_*; do
+ unset DEP_ARCH DEC
+ . "$FILE" nonexistentfn 2>/dev/null
+ SCRIPTNAME="$(basename "$FILE")"
+
+ echo 'package_'${SCRIPTNAME}'() {
+ pkgdesc="'$DEC'"
+ depends=('$DEP_ARCH')
+ provides=('"'"''${SCRIPTNAME}''"'"')
+
+ mkdir -p "$pkgdir/usr/bin"
+ install "$srcdir/f_scripts-$pkgver/scripts/'$SCRIPTNAME'" "$pkgdir/usr/bin/'$SCRIPTNAME'"
+}
+'
+ done
+}
+
+main() {
+ cd "$(dirname $(realpath $0))"
+ header
+ gen
+}
+
+if [ -n "$1" ]; then "$@"; else main; fi
--
2.38.0