diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-05-16 02:07:52 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-05-16 02:08:56 +0200 |
commit | 46b7a69006c9d92aef0540b34312739db922570a (patch) | |
tree | 554c233a9046bda0a25aeccbcb18f5dbe273489d /main/lua-optarg/APKBUILD | |
parent | 857e995d257d2bee8023d2ab1cb6f2cad6f24049 (diff) | |
download | aports-46b7a69006c9d92aef0540b34312739db922570a.tar.bz2 aports-46b7a69006c9d92aef0540b34312739db922570a.tar.xz |
main/lua-optarg: refactor abuild
Diffstat (limited to 'main/lua-optarg/APKBUILD')
-rw-r--r-- | main/lua-optarg/APKBUILD | 59 |
1 files changed, 14 insertions, 45 deletions
diff --git a/main/lua-optarg/APKBUILD b/main/lua-optarg/APKBUILD index 7a39b8b4d7..2db890698a 100644 --- a/main/lua-optarg/APKBUILD +++ b/main/lua-optarg/APKBUILD @@ -1,5 +1,4 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> -_luaversions="5.1 5.2 5.3" pkgname=lua-optarg pkgver=0.1 pkgrel=0 @@ -7,57 +6,27 @@ 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="" +source="$pkgname-$pkgver.tar.gz::https://github.com/ncopa/$pkgname/archive/v$pkgver.tar.gz" +builddir="$srcdir/$pkgname-$pkgver" + +_luaversions="5.1 5.2 5.3" for _v in $_luaversions; do - makedepends="$makedepends lua$_v-dev" - subpackages="$subpackages lua$_v-optarg:split_${_v/./_}" + subpackages="$subpackages lua$_v-${pkgname#lua-}:_package" 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 + mkdir -p "$pkgdir" } -_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 -} +_package() { + local lver="${subpkgname:3:3}" + pkgdesc="$pkgdesc $lver" + depends="lua$lver" + install_if="$pkgname=$pkgver-r$pkgrel lua$lver" -for _v in $_luaversions; do - eval "split_${_v/./_}() { _split $_v; }" -done + install -Dm644 "$builddir"/optarg.lua \ + "$subpkgdir"/usr/share/lua/$lver/optarg.lua +} -md5sums="764d8969e5ec7c38309a030c09b33351 lua-optarg-0.1.tar.gz" -sha256sums="2c20a69d37d0f9af8df0991bb82a4aad7ceef1a4ccbe37773ddad5bc762277c9 lua-optarg-0.1.tar.gz" sha512sums="d110b0a9bee079c48c234c6e77a56951c809b5c924a81975607d68cde432a63b76353800c2fc6a04f6b29503d19f65cd3b7bbd50cd1ce612f4c18e775b5c27a8 lua-optarg-0.1.tar.gz" |