aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-optarg/APKBUILD
blob: f025cf848f56bea34d71f075f794b5854675b5b1 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-optarg
_rockname=optarg
pkgver=0.2
pkgrel=1
pkgdesc="Simple command line option parser for Lua"
url="https://github.com/ncopa/lua-optarg"
arch="noarch"
license="MIT"
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
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done

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

_package() {
	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/$_rockname/$pkgver-1"

	install -Dm644 "$builddir"/optarg.lua \
		"$subpkgdir"/usr/share/lua/$lver/optarg.lua

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

sha512sums="347d958020a3fbd7a0ba553eccc3ba54f0732636e6a880bd254065ae9634b6a9397b0e4f48a720a0597672da62652ec6998c455f2719622ae6e9c06896e5c573  lua-optarg-0.2.tar.gz"