aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-optarg
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-12 12:35:46 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-12 12:37:39 +0000
commit5c295e9a47d10cf926f16cc6a35cbef9ee1ea389 (patch)
tree7aca479dd7eb97770a858640a7f86b2aa0a3a5a0 /testing/lua-optarg
parent199f160a2a497eb684b072d67e95096594dc8098 (diff)
downloadaports-5c295e9a47d10cf926f16cc6a35cbef9ee1ea389.tar.bz2
aports-5c295e9a47d10cf926f16cc6a35cbef9ee1ea389.tar.xz
testing/lua-optarg: new aport
Simple command line option parser for Lua https://github.com/ncopa/lua-optarg
Diffstat (limited to 'testing/lua-optarg')
-rw-r--r--testing/lua-optarg/APKBUILD63
1 files changed, 63 insertions, 0 deletions
diff --git a/testing/lua-optarg/APKBUILD b/testing/lua-optarg/APKBUILD
new file mode 100644
index 0000000000..7a39b8b4d7
--- /dev/null
+++ b/testing/lua-optarg/APKBUILD
@@ -0,0 +1,63 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2 5.3"
+pkgname=lua-optarg
+pkgver=0.1
+pkgrel=0
+pkgdesc="Simple command line option parser for Lua"
+url="https://github.com/ncopa/lua-optarg"
+arch="noarch"
+license="MIT"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages=""
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-optarg:split_${_v/./_}"
+done
+source="lua-optarg-$pkgver.tar.gz::https://github.com/ncopa/lua-optarg/archive/v$pkgver.tar.gz"
+
+_builddir="$srcdir"/lua-optarg-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+}
+
+package() {
+ cd "$_builddir"
+ for _i in $_luaversions; do
+ install -D optarg.lua "$pkgdir"/usr/share/lua/$_i/optarg.lua \
+ || return 1
+ done
+}
+
+_split() {
+ local d= _ver=$1
+ pkgdesc="$pkgdesc for Lua $_ver"
+ install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
+ depends=
+ for d in usr/lib/lua usr/share/lua; do
+ if [ -d "$pkgdir"/$d/$_ver ]; then
+ mkdir -p "$subpkgdir"/$d
+ mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
+ fi
+ done
+}
+
+for _v in $_luaversions; do
+ eval "split_${_v/./_}() { _split $_v; }"
+done
+
+md5sums="764d8969e5ec7c38309a030c09b33351 lua-optarg-0.1.tar.gz"
+sha256sums="2c20a69d37d0f9af8df0991bb82a4aad7ceef1a4ccbe37773ddad5bc762277c9 lua-optarg-0.1.tar.gz"
+sha512sums="d110b0a9bee079c48c234c6e77a56951c809b5c924a81975607d68cde432a63b76353800c2fc6a04f6b29503d19f65cd3b7bbd50cd1ce612f4c18e775b5c27a8 lua-optarg-0.1.tar.gz"