aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-optparse/APKBUILD
blob: 93a1d427513a6bb7d5998a6b675ec7334ab93c72 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-optparse
_pkgname=optparse
pkgver=1.2
pkgrel=1
pkgdesc="Parse and process command-line options"
url="https://github.com/gvvaughan/optparse"
arch="noarch"
license="MIT"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/gvvaughan/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"  # tests requires additional dependencies

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

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

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

	cd "$builddir"
	mkdir -p "$lmod_dir"
	cp -r "$builddir"/lib/* "$lmod_dir"/

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="65d5a2a0ad05b1f43fdfe28cbc84aa9eb718d0691da24ad23a92f6ca18da29b68107cbdb1c27d45d9b0aeec01f2ed8bd6755b692db40bb871865690f49a018c9  lua-optparse-1.2.tar.gz"