aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-06 19:53:49 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-06 19:53:49 +0000
commite85ebca6f8b9dbb2a7f48882e8655ba85e0d9720 (patch)
tree2b56e7d5c0c341bda77def4b54fb7abde2f438c0
parentfa1baf0130b30ee79addb765dbb73aeeece01625 (diff)
downloadaports-e85ebca6f8b9dbb2a7f48882e8655ba85e0d9720.tar.bz2
aports-e85ebca6f8b9dbb2a7f48882e8655ba85e0d9720.tar.xz
main/lua-lustache: add lua 5.3 and use install_if
-rw-r--r--main/lua-lustache/APKBUILD46
1 files changed, 32 insertions, 14 deletions
diff --git a/main/lua-lustache/APKBUILD b/main/lua-lustache/APKBUILD
index 4a6cef9c0b..205c50d933 100644
--- a/main/lua-lustache/APKBUILD
+++ b/main/lua-lustache/APKBUILD
@@ -1,16 +1,22 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-pkgname=lua-lustache
+_luaversions="5.1 5.2 5.3"
+_name=lustache
+pkgname=lua-$_name
pkgver=1.3
-pkgrel=1
+pkgrel=2
pkgdesc="Logic-less {{mustache}} templates with Lua"
url="http://olivinelabs.com/lustache/"
arch="noarch"
license="MIT"
-depends="lua5.1-lustache lua5.2-lustache"
+depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
-subpackages="lua5.1-lustache:_lua51 lua5.2-lustache:_lua52"
+subpackages="$pkgname-common"
+for _i in $_luaversions; do
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-$_name:split_${_i/./_}"
+done
source="lua-lustache-$pkgver.tar.gz::https://github.com/Olivine-Labs/lustache/archive/v$pkgver.tar.gz"
_builddir="$srcdir"/lustache-$pkgver
@@ -30,28 +36,40 @@ build() {
package() {
cd "$_builddir"
- mkdir -p "$pkgdir"/usr/share/lua/5.2/lustache \
- "$pkgdir"/usr/share/lua/5.1
+ mkdir -p "$pkgdir"/usr/share/lua/common/lustache
install -m644 src/lustache/*.lua \
- "$pkgdir"/usr/share/lua/5.2/lustache/ || return 1
+ "$pkgdir"/usr/share/lua/common/lustache/ || return 1
install -mg66 src/lustache.lua \
- "$pkgdir"/usr/share/lua/5.2/
-
- for i in lustache lustache.lua; do
- ln -s ../5.2/$i "$pkgdir"/usr/share/lua/5.1/$i || return 1
+ "$pkgdir"/usr/share/lua/common/
+
+ for _v in $_luaversions; do
+ mkdir -p "$pkgdir"/usr/share/lua/$_v
+ for i in lustache lustache.lua; do
+ ln -s ../common/$i "$pkgdir"/usr/share/lua/$_v/$i \
+ || return 1
+ done
done
}
+
+common() {
+ pkgdesc="Logic-less {{mustache}} templates with Lua $1"
+ mkdir -p "$subpkgdir"/usr/share/lua/
+ mv "$pkgdir"/usr/share/lua/common "$subpkgdir"/usr/share/lua/
+}
+
_split() {
pkgdesc="Logic-less {{mustache}} templates with Lua $1"
- depends=
+ install_if="lua$1 $pkgname=$pkgver-r$pkgrel"
+ depends="$pkgname-common"
mkdir -p "$subpkgdir"/usr/share/lua/
mv "$pkgdir"/usr/share/lua/$1 "$subpkgdir"/usr/share/lua/ || return 1
}
-_lua51() { _split 5.1; depends="lua5.2-lustache";}
-_lua52() { _split 5.2; }
+for _v in $_luaversions; do
+ eval "split_${_v/./_}() { _split $_v; }"
+done
md5sums="4ac0cd6dfda1e5f3ba44375b560da58b lua-lustache-1.3.tar.gz"
sha256sums="e694b9bc58fb5e6cebf7840137a5b5ecafcc27a75c33a5da5b0cf6fef1a6906d lua-lustache-1.3.tar.gz"