diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-04-06 12:29:13 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-04-06 12:29:13 +0000 |
commit | 27abf36e91d66a0f7c5b860d211efa34daf99bf9 (patch) | |
tree | 7723f34fd1583d54b075d6f6c0149057ed19a13c | |
parent | 96664e6d0f4d3caf8d310e2ee5aa02b1c27d5f9a (diff) | |
download | aports-27abf36e91d66a0f7c5b860d211efa34daf99bf9.tar.bz2 aports-27abf36e91d66a0f7c5b860d211efa34daf99bf9.tar.xz |
main/lua-alt-getopt: use install_if
-rw-r--r-- | main/lua-alt-getopt/APKBUILD | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/main/lua-alt-getopt/APKBUILD b/main/lua-alt-getopt/APKBUILD index a1d05ffd1a..08d8191bd0 100644 --- a/main/lua-alt-getopt/APKBUILD +++ b/main/lua-alt-getopt/APKBUILD @@ -1,7 +1,8 @@ # Maintainer: Natanael Copa <ncopa@alpinlinux.org> +_luaversions="5.1 5.2" pkgname=lua-alt-getopt pkgver=0.7.0 -pkgrel=4 +pkgrel=5 pkgdesc="Lua module for processing options similar to getopt_long(3)" url="http://luaforge.net/projects/alt-getopt/" arch="noarch" @@ -9,7 +10,11 @@ license="MIT" depends="lua5.1-alt-getopt lua5.2-alt-getopt" makedepends= install= -subpackages="lua5.1-alt-getopt:_51 lua5.2-alt-getopt:_52" +subpackages="" +for _v in $_luaversions; do + makedepends="$makedepends lua$_v-dev" + subpackages="$subpackages lua$_v-alt-getopt:split_${_v/./_}" +done source="http://mova.org/~cheusov/pub/lua_alt_getopt/lua-alt-getopt-$pkgver.tar.gz" _builddir="$srcdir"/$pkgname-$pkgver @@ -23,22 +28,29 @@ build() { package() { cd "$_builddir" - mkdir -p "$pkgdir"/usr/share/lua/5.1 "$pkgdir"/usr/share/lua/5.2 - install -Dm644 alt_getopt.lua "$pkgdir"/usr/share/lua/5.2/alt_getopt.lua - ln -s ../5.2/alt_getopt.lua "$pkgdir"/usr/share/lua/5.1/alt_getopt.lua + for _i in $_luaversions; do + mkdir -p "$pkgdir"/usr/share/lua/$_i + install -Dm644 alt_getopt.lua \ + "$pkgdir"/usr/share/lua/$_i/alt_getopt.lua \ + || return 1 + done } -_52() { - depends="" - mkdir -p "$subpkgdir"/usr/share/lua/ - mv "$pkgdir"/usr/share/lua/5.2 "$subpkgdir"/usr/share/lua/ +_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 } -_51() { - replaces="lua-alt-getopt" - depends="lua5.2-alt-getopt" - mkdir -p "$subpkgdir"/usr/share/lua/ - mv "$pkgdir"/usr/share/lua/5.1 "$subpkgdir"/usr/share/lua/ -} +for _v in $_luaversions; do + eval "split_${_v/./_}() { _split $_v; }" +done md5sums="f504578b1287ea02759add231b972812 lua-alt-getopt-0.7.0.tar.gz" |