aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-posixtz
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-01-19 16:03:50 +0000
committerTed Trask <ttrask01@yahoo.com>2015-01-19 16:04:53 +0000
commit51d97783e8ff1826dc60c68d17abdc108c3aa04b (patch)
tree28bbae3d1d405408bc783962e86fc60ca49fef3d /main/lua-posixtz
parent4ec7013ddc9d974030e54b64b3089727db236fc1 (diff)
downloadaports-51d97783e8ff1826dc60c68d17abdc108c3aa04b.tar.bz2
aports-51d97783e8ff1826dc60c68d17abdc108c3aa04b.tar.xz
main/lua-posixtz: upgrade to 0.5 and create subpackages for Lua 5.1 and 5.2 support
Diffstat (limited to 'main/lua-posixtz')
-rw-r--r--main/lua-posixtz/APKBUILD62
1 files changed, 47 insertions, 15 deletions
diff --git a/main/lua-posixtz/APKBUILD b/main/lua-posixtz/APKBUILD
index 086dc439bb..7a0b209cba 100644
--- a/main/lua-posixtz/APKBUILD
+++ b/main/lua-posixtz/APKBUILD
@@ -1,40 +1,72 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2"
pkgname=lua-posixtz
-pkgver=0.3
+pkgver=0.5
pkgrel=0
pkgdesc="Lua module to extract POSIX timezone from tzdata"
-url="http://git.alpinelinux.org/cgit/ncopa/posixtz.git/"
+url="http://git.alpinelinux.org/cgit/posixtz.git/"
arch="all"
license="GPLv2"
depends=
-makedepends="lua-dev"
install=
-subpackages=
-source="http://dev.alpinelinux.org/archive/posixtz/posixtz-$pkgver.tar.bz2"
+depends_dev=""
+makedepends="$depends_dev"
+subpackages=""
+for _i in $_luaversions; do
+ depends="$depends lua$_i-posixtz"
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-posixtz:split_${_i/./_}"
+done
+source="http://dev.alpinelinux.org/archive/posixtz/posixtz-$pkgver.tar.xz"
+
+_sdir="$srcdir"/posixtz-$pkgver
-_builddir="$srcdir"/posixtz-$pkgver
prepare() {
local i
- 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 core.so || return 1
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ make LUAPC="lua$_i" core.so || return 1
+ done
}
package() {
- cd "$_builddir"
- install -D core.so "$pkgdir"/usr/lib/lua/5.1/posixtz/core.so
- install -D posixtz.lua "$pkgdir"/usr/share/lua/5.1/posixtz.lua
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ install -D core.so "$pkgdir"/usr/lib/lua/$_i/posixtz/core.so
+ install -D posixtz.lua "$pkgdir"/usr/share/lua/$_i/posixtz.lua
+ done
}
-md5sums="99efce32b3f870e1b071ce47f3a98a18 posixtz-0.3.tar.bz2"
-sha256sums="574a765e0569458d7ccb76e97b3a96de2f0c19ad093c6811675b8a57f7088a53 posixtz-0.3.tar.bz2"
-sha512sums="57dfd38a4050230e49ec9a23bfec5e995dd48ed1fa338a72c4d2c3b86590d4c7357d3dc6d12b4f1564beebcf48f0d0ed855574e4ba29268160d8f84928a477fd posixtz-0.3.tar.bz2"
+_split() {
+ local d= _ver=$1
+ pkgdesc="Lua $_ver module to extract POSIX timezone from tzdata"
+ replaces="$pkgname"
+ 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
+}
+
+for _i in $_luaversions; do
+ eval "split_${_i/./_}() { _split $_i; }"
+done
+
+md5sums="80f8ae1df19dd28e1c8b192c6ea7b836 posixtz-0.5.tar.xz"
+sha256sums="e0a79e0922be2da686a1888d79cd253baaf81c2f30b4378fbbcf9ff9d632aab5 posixtz-0.5.tar.xz"
+sha512sums="68dbaab9f4aef166ac2f2d40b49366527b840bebe17a47599fe38345835e4adb8a767910745ece9c384b57af815a871243c3e261a29f41d71f8054df3061b3fd posixtz-0.5.tar.xz"