aboutsummaryrefslogblamecommitdiffstats
path: root/community/lua-cliargs/APKBUILD
blob: adea9625b2af1b801348561ee1ad937695729c3f (plain) (tree)
1
2
3
4
5
6
7





                                               
        























                                                                                              
                                                                                  





                                         
                                           
 
                                                      


                                                                                                                                                                       
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-cliargs
_pkgname=lua_cliargs
pkgver=3.0.1
_pkgver=${pkgver%.*}-${pkgver##*.}
pkgrel=1
pkgdesc="A command-line argument parsing module for Lua"
url="https://github.com/amireh/lua_cliargs"
arch="noarch"
license="MIT"
makedepends=""
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/amireh/$_pkgname/archive/v$_pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$_pkgver"

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	makedepends="$makedepends luarocks$_v"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

package() {
	mkdir -p "$pkgdir"
}

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc $lver"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$_pkgver"

	cd "$builddir"

	luarocks-$lver install \
		--deps-mode=none \
		--tree="$subpkgdir/usr" \
		$_pkgname-$_pkgver.rockspec

	rm -r "$rockdir"/../../manifest "$rockdir"/doc
}

sha512sums="2bdcd3c790a82351df598cb3d289de980fe771222ebd9715036678eecdbe51b7563d24629afa4d286b900d722bf844004d12f2330744a1e644d9286ac44b4dbe  lua-cliargs-3.0.1.tar.gz"