aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-cliargs/APKBUILD
blob: 00f43ff0662fe054f7326dd9a6bfa88b526893d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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=0
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"

	cd "$builddir"

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

	# Remove LuaRock manifests.
	rm -Rf "$subpkgdir"/usr/lib/luarocks
	rmdir "$subpkgdir"/usr/lib
}

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