aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-22 08:03:19 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-22 08:03:19 +0000
commit6547bcf369460a3d8634818747643b79ed8a4b48 (patch)
treee46f22503002b6b2424e3bbccd4dc7ef82316ee1 /main
parent65ad6416de8aa5139eeb12b888c129e5d2edfd2f (diff)
downloadaports-6547bcf369460a3d8634818747643b79ed8a4b48.tar.bz2
aports-6547bcf369460a3d8634818747643b79ed8a4b48.tar.xz
main/lua-discount: add Lua 5.3 and use install_if
Diffstat (limited to 'main')
-rw-r--r--main/lua-discount/APKBUILD33
1 files changed, 21 insertions, 12 deletions
diff --git a/main/lua-discount/APKBUILD b/main/lua-discount/APKBUILD
index 249bdca876..dd3699c91e 100644
--- a/main/lua-discount/APKBUILD
+++ b/main/lua-discount/APKBUILD
@@ -1,23 +1,27 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2 5.3"
pkgname=lua-discount
pkgver=1.2.10.1
-pkgrel=3
-pkgdesc="Lua binding to discount, a Markdown implementation in C"
+pkgrel=4
+pkgdesc="Markdown implementation in C for Lua"
url="http://asbradbury.org/projects/lua-discount"
arch="all"
license="BSD"
-depends="lua5.1-discount lua5.2-discount"
-makedepends="lua5.1-dev lua5.2-dev"
+depends=""
+subpackages=""
+makedepends=""
+for _i in $_luaversions; do
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-discount:split_${_i/./_}"
+done
install=
-subpackages="lua5.1-discount:_lua51 lua5.2-discount:_lua52"
source="http://luaforge.net/frs/download.php/3758/lua-discount-1.2.10.1.tar.gz"
build() {
cd "$srcdir"
-
- for i in 5.1 5.2; do
+ for i in $_luaversions; do
cp -r $pkgname-$pkgver $i
(cd $i
make INCS="$(pkg-config --cflags lua$i)"
@@ -27,19 +31,24 @@ build() {
package() {
cd "$srcdir"
- for i in 5.1 5.2; do
+ for i in $_luaversions; do
install -D -m644 $i/discount.so \
"$pkgdir"/usr/lib/lua/$i/discount.so || return 1
done
}
_split() {
- pkgdesc="Lua $1 binding to discount, a Markdown implementation in C"
+ local _ver=$1
+ pkgdesc="$pkgdesc $_ver"
+ install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
+ depends=""
mkdir -p "$subpkgdir"/usr/lib/lua/
- mv "$pkgdir"/usr/lib/lua/$1 "$subpkgdir"/usr/lib/lua/ || return 1
+ mv "$pkgdir"/usr/lib/lua/$_ver "$subpkgdir"/usr/lib/lua/ || return 1
}
-_lua51() { _split 5.1; }
-_lua52() { _split 5.2; }
+for _v in $_luaversions; do
+ eval "split_${_v/./_}() { _split $_v; }"
+done
+
md5sums="7dc7055816dc755aacb48bfd5eb2eb5b lua-discount-1.2.10.1.tar.gz"