aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-augeas/APKBUILD
blob: ea8f1e2bbecaee53fa2f80555699e5153930809d (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
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

_luaversions="5.1 5.2 5.3"

pkgname=lua-augeas
pkgver=0.1.2
pkgrel=3
pkgdesc="Lua bindings for Augeas"
url="http://git.alpinelinux.org/cgit/lua-augeas/"
arch="all"
license="LGPL"
depends=""
install=
makedepends="augeas-dev"
subpackages=""
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-augeas:split_${_i/./_}"
done
source="http://dev.alpinelinux.org/archive/lua-augeas/lua-augeas-$pkgver.tar.bz2
	0001-support-for-Lua-5.2.patch"

_sdir="$srcdir"/lua-augeas-$pkgver
prepare() {
	cd "$_sdir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	for _i in $_luaversions; do
		cp -r "$_sdir" "$srcdir"/build-$_i
	done
}

build() {
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		make LUAPC=lua$_i || return 1
	done
}

package() {
	for _i in $_luaversions; do
		install -D "$srcdir"/build-$_i/augeas.so \
			"$pkgdir"/usr/lib/lua/$_i/augeas.so || return 1
	done
}

_split() {
	local d= _ver=$1
	pkgdesc="Lua $_i bindings for Augeas"
	replaces="$pkgname"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends=
	for d in usr/lib/lua usr/share/lua; do
		if [ -d "$pkgdir"/$d/$_ver ]; then
			mkdir -p "$subpkgdir"/$d
			mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
		fi
	done
}

split_5_1() { _split 5.1; }
split_5_2() { _split 5.2; }
split_5_3() { _split 5.3; }

md5sums="20581b3eb4cc38491dec561ab9a9c156  lua-augeas-0.1.2.tar.bz2
31296c5db6d0cf66c368f5c41b9147c1  0001-support-for-Lua-5.2.patch"
sha256sums="1a4c273bdfad0106645fee85bcea2115b76ef7bab87cfad07c0c04eb331a85e3  lua-augeas-0.1.2.tar.bz2
9ad43ff0492e0fa7d253fb55f62b5aee8e53374907fa11e16ba6b165dd4622df  0001-support-for-Lua-5.2.patch"
sha512sums="3ccbb32d4d71a9d390e814084a91fc26d51f25d31a1ff3a1e9927c494d196fdbc3954ae763b18e3b6e938bba9090773e4ac5fdb93ebc6d3293dc6be351485459  lua-augeas-0.1.2.tar.bz2
35ce609c0f34d88b3cd3a2edc6b7bc4332de9b06ad9b57a2fcc54c655399ad8e426b224e064d86146ccc1258ae7cb58a33d6187e7d5f396888a1d5a61637c940  0001-support-for-Lua-5.2.patch"