aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-json4
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-01-12 19:45:08 +0000
committerTed Trask <ttrask01@yahoo.com>2015-01-12 19:45:08 +0000
commitbd2725ad2259191a162e5547ffaa2d91e66c7499 (patch)
tree682495e321f7cca9dd145881a39e60d25e4c7bb1 /main/lua-json4
parent385c2821adf18e6ea1ffba8c854a2a77e242c9d3 (diff)
downloadaports-bd2725ad2259191a162e5547ffaa2d91e66c7499.tar.bz2
aports-bd2725ad2259191a162e5547ffaa2d91e66c7499.tar.xz
main/lua-json4: Create subpackages for Lua 5.1 and 5.2 support
Diffstat (limited to 'main/lua-json4')
-rw-r--r--main/lua-json4/APKBUILD33
1 files changed, 29 insertions, 4 deletions
diff --git a/main/lua-json4/APKBUILD b/main/lua-json4/APKBUILD
index 523488799b..64d14833f8 100644
--- a/main/lua-json4/APKBUILD
+++ b/main/lua-json4/APKBUILD
@@ -1,13 +1,19 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2"
pkgname=lua-json4
_name=json4lua
pkgver=0.9.50
-pkgrel=0
+pkgrel=1
pkgdesc="JSON encoding / decoding module for Lua (JSON4lua)"
url="http://json.luaforge.net/"
arch="noarch"
license="GPL-2"
-depends="lua"
+depends=""
+subpackages=""
+for _i in $_luaversions; do
+ depends="$depends lua$_i-json4"
+ subpackages="$subpackages lua$_i-json4:split_${_i/./_}"
+done
source="http://files.luaforge.net/releases/json/json/$pkgver/json4lua-$pkgver.zip"
replaces="json4lua"
@@ -17,10 +23,29 @@ build() {
}
package() {
- install -D "$srcdir"/json4lua-$pkgver/json/json.lua \
- "$pkgdir"/usr/share/lua/5.1/json.lua
+ for _i in $_luaversions; do
+ install -D "$srcdir"/json4lua-$pkgver/json/json.lua \
+ "$pkgdir"/usr/share/lua/$_i/json.lua
+ done
}
+_split() {
+ local d= _ver=$1
+ pkgdesc="JSON encoding / decoding module for Lua $_ver (JSON4lua)"
+ replaces="$pkgname"
+ depends="lua"
+ 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="d04a44972ec697a14e89b3a7f14c2d29 json4lua-0.9.50.zip"
sha256sums="9565ebd1b0a95d84915221f2f401f913de92e7135c6d6ebdb38eff636a934ef1 json4lua-0.9.50.zip"
sha512sums="7cfe0f68eea2e40e59f45359e1e867fb8aa306bdc211be3596ba6c2718687401564f365975cbbbce3d05e76bde46a42303c37a2b320ffa77212902465fac0ae6 json4lua-0.9.50.zip"