aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-lustache/APKBUILD
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-02 11:22:58 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-02 11:23:32 +0200
commitc1d4bad676a122134e5c5e1b28821091fc6b01c9 (patch)
tree5845e669cb2546a501bb8bd7629ac17185c28ecd /main/lua-lustache/APKBUILD
parentd4c3e63c7c850e9efb84ee3d6332812bba937bcb (diff)
downloadaports-c1d4bad676a122134e5c5e1b28821091fc6b01c9.tar.bz2
aports-c1d4bad676a122134e5c5e1b28821091fc6b01c9.tar.xz
main/lua-lustache: simplify abuild
Diffstat (limited to 'main/lua-lustache/APKBUILD')
-rw-r--r--main/lua-lustache/APKBUILD76
1 files changed, 25 insertions, 51 deletions
diff --git a/main/lua-lustache/APKBUILD b/main/lua-lustache/APKBUILD
index 6d0b51401d..3934ee189e 100644
--- a/main/lua-lustache/APKBUILD
+++ b/main/lua-lustache/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
-_name=lustache
-pkgname=lua-$_name
+_pkgname=lustache
+pkgname=lua-$_pkgname
pkgver=1.3.1
_pkgver=$pkgver-0
pkgrel=0
@@ -10,68 +10,42 @@ url="http://olivinelabs.com/lustache/"
arch="noarch"
license="MIT"
depends=""
-depends_dev=""
-makedepends="$depends_dev"
-install=""
+makedepends=""
subpackages="$pkgname-common"
-for _i in $_luaversions; do
- makedepends="$makedepends lua$_i-dev"
- subpackages="$subpackages lua$_i-$_name:split_${_i/./_}"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done
-source="lua-lustache-$pkgver.tar.gz::https://github.com/Olivine-Labs/lustache/archive/v$_pkgver.tar.gz"
-
-_builddir="$srcdir"/lustache-$_pkgver
-prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
-}
+source="$pkgname-$pkgver.tar.gz::https://github.com/Olivine-Labs/$_pkgname/archive/v$_pkgver.tar.gz"
+builddir="$srcdir/$_pkgname-$_pkgver"
-build() {
- cd "$_builddir"
+package() {
+ mkdir -p "$pkgdir"
}
-package() {
- cd "$_builddir"
- mkdir -p "$pkgdir"/usr/share/lua/common/lustache
+common() {
+ cd "$builddir"
+ mkdir -p "$subpkgdir"/usr/share/lua/common/$_pkgname
install -m644 src/lustache/*.lua \
- "$pkgdir"/usr/share/lua/common/lustache/ || return 1
+ "$subpkgdir"/usr/share/lua/common/$_pkgname/ || return 1
install -m644 src/lustache.lua \
- "$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
+ "$subpkgdir"/usr/share/lua/common/
}
+_package() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc $lver"
+ depends="$pkgname-common lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
-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"
- 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
+ mkdir -p "$subpkgdir"/usr/share/lua/$lver
+ local path; for path in lustache lustache.lua; do
+ ln -s ../common/$path "$subpkgdir"/usr/share/lua/$lver/$path \
+ || return 1
+ done
}
-for _v in $_luaversions; do
- eval "split_${_v/./_}() { _split $_v; }"
-done
-
md5sums="e4416abe1a822c1b2d4b3a9e702d5795 lua-lustache-1.3.1.tar.gz"
sha256sums="540bd5e1f6d32aa44d5be946d1772910fb73b62fa909ca5a026c115ece4170f0 lua-lustache-1.3.1.tar.gz"
sha512sums="f1ba0bdd38e60957df1995f32a73a16d1b430072af4e14cce530345c74d542021223c0ef41b0f997f88d762bb194fff7119701cd289e16e3e38dfe3f10d0d9d8 lua-lustache-1.3.1.tar.gz"