aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-augeas/APKBUILD
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-08 07:52:33 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-08 07:55:11 +0000
commit2b36a37f0561474833aab608c2d255e6c8702037 (patch)
treea1da0fff4f323a9ec4e690c40b82c19e52b495a1 /main/lua-augeas/APKBUILD
parentd7f917efc874245d2a8448e38f5910b856d5bae3 (diff)
downloadaports-2b36a37f0561474833aab608c2d255e6c8702037.tar.bz2
aports-2b36a37f0561474833aab608c2d255e6c8702037.tar.xz
main/lua-augeas: build for both lua 5.1 and 5.2
Diffstat (limited to 'main/lua-augeas/APKBUILD')
-rw-r--r--main/lua-augeas/APKBUILD67
1 files changed, 53 insertions, 14 deletions
diff --git a/main/lua-augeas/APKBUILD b/main/lua-augeas/APKBUILD
index d2b0d32c07..53ea3db853 100644
--- a/main/lua-augeas/APKBUILD
+++ b/main/lua-augeas/APKBUILD
@@ -1,32 +1,71 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
+_luaversions="5.1 5.2"
+_defaultlua="5.1"
+
pkgname=lua-augeas
pkgver=0.1.2
-pkgrel=0
+pkgrel=1
pkgdesc="Lua bindings for Augeas"
url="http://git.alpinelinux.org/cgit/lua-augeas/"
arch="all"
license="LGPL"
-depends=
-makedepends="lua-dev pkgconfig augeas-dev"
+depends="lua$_defaultlua-augeas"
install=
-subpackages=
-source="http://git.alpinelinux.org/cgit/lua-augeas.git/snapshot/lua-augeas-$pkgver.tar.bz2"
+makedepends="augeas-dev"
+subpackages=""
+for _i in $_luaversions; do
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-augeas:split_${_i/./_}"
+done
+source="http://git.alpinelinux.org/cgit/lua-augeas.git/snapshot/lua-augeas-$pkgver.tar.bz2
+ 0001-support-for-Lua-5.2.patch"
-_builddir="$srcdir"/$pkgname-$pkgver
+_sdir="$srcdir"/lua-augeas-$pkgver
prepare() {
- cd "$_builddir"
+ 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() {
- cd "$_builddir"
- make || return 1
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ make LUAPC=lua$_i || return 1
+ done
}
package() {
- cd "$_builddir"
- install -D augeas.so "$pkgdir"/usr/lib/lua/5.1/augeas.so
+ for _i in $_luaversions; do
+ install -D "$srcdir"/build-$_i/augeas.so \
+ "$pkgdir"/usr/lib/lua/$_i/augeas.so || return 1
+ done
}
-md5sums="20581b3eb4cc38491dec561ab9a9c156 lua-augeas-0.1.2.tar.bz2"
-sha256sums="1a4c273bdfad0106645fee85bcea2115b76ef7bab87cfad07c0c04eb331a85e3 lua-augeas-0.1.2.tar.bz2"
-sha512sums="3ccbb32d4d71a9d390e814084a91fc26d51f25d31a1ff3a1e9927c494d196fdbc3954ae763b18e3b6e938bba9090773e4ac5fdb93ebc6d3293dc6be351485459 lua-augeas-0.1.2.tar.bz2"
+_split() {
+ local d= _ver=$1
+ pkgdesc="Lua $_i bindings for Augeas"
+ replaces="$pkgname"
+ 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; }
+
+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"