Subject: [alpine-aports] [PATCH] testing/haserl version bump to 0.9.34

From: Nathan Angelacos <[email-masked]>
Date: Mon, 16 Feb 2015 00:12:14 +0000

In testing and not main because this version
	only builds against lua 5.2 and 5.3
---
 testing/haserl/APKBUILD | 83 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 59 insertions(+), 24 deletions(-)

diff --git a/testing/haserl/APKBUILD b/testing/haserl/APKBUILD
index ee1fd60..5f53255 100644
--- a/testing/haserl/APKBUILD
+++ b/testing/haserl/APKBUILD
@@ -1,45 +1,80 @@
 # Maintainer: Natanael Copa <[email-masked]>
-_luaver=5.2
+_luaversions="5.3 5.2"
+_defaultlua="5.3"
 pkgname=haserl
-pkgver=0.9.32
+pkgver=0.9.34
 pkgrel=1
-pkgdesc="Html And Shell Embedded Report Language (with Lua $_luaver support)"
+pkgdesc="Html And Shell Embedded Report Language"
 url="http://haserl.sourceforge.net/"
 arch="all"
-license="GPL-2"
-depends=
-makedepends="lua$_luaver-dev"
+license="GPL2"
+depends=""
+makedepends="automake autoconf"
 subpackages="$pkgname-doc"
-source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
-	"
+for _i in $_luaversions; do
+	depends="$depends haserl-lua$_i"
+	makedepends="$makedepends lua$_i-dev"
+	subpackages="$subpackages haserl-lua$_i:split_${_i/./_}"
+done
+options="suid"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
 
-_builddir="$srcdir/$pkgname-$pkgver"
+_sdir="$srcdir"/$pkgname-$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
+	sed -i -e 's/^        /\t/' src/Makefile.am || return 1
+	rm -f src/haserl_lualib.inc
+
+	aclocal && autoconf && autoheader && automake --add-missing || return 1
+
+	for _i in $_luaversions; do
+		cp -r "$_sdir" "$srcdir"/build-$_i
+	done
 }
 
 build() {
-	cd "$_builddir"
-	./configure \
-		--build=$CBUILD \
-		--host=$CHOST \
-		--prefix=/usr \
-		--with-lua=lua$_luaver \
-		|| return 1
-	make || return 1
+	for _i in $_luaversions; do
+		cd "$srcdir"/build-$_i
+		./configure \
+			--build=$CBUILD \
+			--host=$CHOST \
+			--prefix=/usr \
+			--with-lua=lua$_i \
+			|| return 1
+		make || return 1
+	done
 }
 
 package() {
-	cd "$_builddir"
-	make DESTDIR="$pkgdir/" install
-	chmod 4111 "$pkgdir"/usr/bin/haserl
+	for _i in $_luaversions; do
+		cd "$srcdir"/build-$_i
+		make DESTDIR="$pkgdir/" install || return 1
+		chmod 4111 "$pkgdir"/usr/bin/haserl
+		mv "$pkgdir"/usr/bin/haserl "$pkgdir"/usr/bin/haserl-lua$_i
+	done
+	ln -s haserl-lua$_defaultlua "$pkgdir"/usr/bin/haserl
+}
+
+_split() {
+	local d= _ver=$1
+	pkgdesc="Html And Shell Embedded Report Language with Lua $_ver support"
+	replaces="$pkgname"
+	depends=
+	if [ -f "$pkgdir"/usr/bin/haserl-lua$_ver ]; then
+		mkdir -p "$subpkgdir"/usr/bin
+		mv "$pkgdir"/usr/bin/haserl-lua$_ver "$subpkgdir"/usr/bin/ || return 1
+	fi
 }
 
-md5sums="18e2208aea6d772d1670c1a648bb6b77  haserl-0.9.32.tar.gz"
-sha256sums="c93aea462cddce1cda5a712f50bcad2197d987bdc01477ddb79347c0d4fae26f  haserl-0.9.32.tar.gz"
-sha512sums="9ccd9037abade1f4654ea42c594218bac19668ad1485b6e40e1c50af76db69861ade4a80f420bc97b4a722047f239970297c52317f3071a31eaadba88a4f57b2  haserl-0.9.32.tar.gz"
+for _i in $_luaversions; do
+	eval "split_${_i/./_}() { _split $_i; }"
+done
+
+md5sums="cae2240f25040c7a0a270c35cf7abda4  haserl-0.9.34.tar.gz"
+sha256sums="2b6d2051465a9108d9dfe3e20dccc440f55b39f579fca1d69fc99240b8dba543  haserl-0.9.34.tar.gz"
+sha512sums="22876271255926d7832db4786859e4e30fccc6f9aab5c272adc05186b298e53fd2e3cee855ff03d8129fa66995e06f183133b9208d0d8525a72782fcf63e71cf  haserl-0.9.34.tar.gz"
-- 
2.2.2

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---