aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-lxc/APKBUILD
blob: ddc73e692e8ad1abaa23a3a7ceeb7a8b3271a46e (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=lua-lxc
pkgver=3.0.2
pkgrel=0
pkgdesc="Lua bindings for LXC"
url="https://linuxcontainers.org"
arch="all"
license="LGPL-2.1"
depends=""
makedepends="lxc-dev automake autoconf libtool"
install=""
source="https://linuxcontainers.org/downloads/lxc/lua-lxc-$pkgver.tar.gz"
builddir="$srcdir/lua-lxc-$pkgver"

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

build() {
	cd "$builddir"
	# configure will complain about missing automake randomly
	./autogen.sh
	local lver; for lver in $_luaversions; do
		export LUA_VERSION=$lver
		cp -r "$builddir" "$srcdir"/lua$lver
		cd "$srcdir"/lua$lver
		./configure \
			--build=$CBUILD \
			--host=$CHOST \
			--prefix=/usr \
			--sysconfdir=/etc \
			--mandir=/usr/share/man \
			--localstatedir=/var
		make
	done
}

check() {
	local lver; for lver in $_luaversions; do
		msg "Running check for Lua $lver"
		cd "$srcdir"/lua$lver
		make check
	done
}

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

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (for Lua $lver)"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	cd "$srcdir"/lua$lver
	make DESTDIR="$subpkgdir" install
}

sha512sums="6c85b364166d280d1249f4bec53952d90e404a4fd6ceb5742f50fa3493d9b5113d4153129bb79ac99b465aac0b056d6f59479510555bb3b665ab7569b4b221bf  lua-lxc-3.0.2.tar.gz"