aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-filesystem
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-08 07:42:18 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-08 07:55:10 +0000
commit15f1b80a6c00c9b26283ff4befd53d3744b67cc3 (patch)
treee4cc5a572ea24c2f54433b387a4bfe5e80e9a5f9 /main/lua-filesystem
parent36ba6779f96c74ca0734f024502d2493c63cef29 (diff)
downloadaports-15f1b80a6c00c9b26283ff4befd53d3744b67cc3.tar.bz2
aports-15f1b80a6c00c9b26283ff4befd53d3744b67cc3.tar.xz
main/lua-filesystem: build for both lua 5.1 and 5.2
Diffstat (limited to 'main/lua-filesystem')
-rw-r--r--main/lua-filesystem/APKBUILD56
1 files changed, 45 insertions, 11 deletions
diff --git a/main/lua-filesystem/APKBUILD b/main/lua-filesystem/APKBUILD
index 2668fae1ac..079f115e6d 100644
--- a/main/lua-filesystem/APKBUILD
+++ b/main/lua-filesystem/APKBUILD
@@ -1,31 +1,65 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
+_luaversions="5.1 5.2"
+_defaultlua="5.1"
+
pkgname=lua-filesystem
pkgver=1.6.2
-pkgrel=0
-pkgdesc="Lua library to complement the set of functions related to file systems"
+pkgrel=1
+pkgdesc="Filesystem functions for Lua"
url="http://www.keplerproject.org/luafilesystem/"
arch="all"
license="GPL"
-depends=
-makedepends="lua-dev wget"
+depends="lua$_defaultlua-filesystem"
install=
-subpackages=
+
+makedepends=""
+subpackages=""
+for _i in $_luaversions; do
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-filesystem:split_${_i/./_}"
+done
source="https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-$pkgver.tar.gz"
-_builddir="$srcdir"/luafilesystem-$pkgver
+_sdir="$srcdir"/luafilesystem-$pkgver
+
prepare() {
- cd "$_builddir"
+ cd "$_sdir"
# apply patches here
+ cd "$srcdir"
+ for _i in $_luaversions; do
+ cp -r "$_sdir" "$srcdir"/build-$_i
+ done
}
build() {
- cd "$_builddir"
- make || return 1
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ make CFLAGS="$CFLAGS $( pkg-config lua$_i --cflags ) -fPIC" \
+ || return 1
+ done
}
package() {
- cd "$_builddir"
- make LUA_LIBDIR="$pkgdir"/usr/lib/lua/5.1 install
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ make LUA_LIBDIR="$pkgdir"/usr/lib/lua/$_i install \
+ || return 1
+ done
}
+_split() {
+ local d= _ver=$1
+ pkgdesc="Filesystem functions for Lua $_ver"
+ 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
+}
+
+split_5_1() { _split 5.1; }
+split_5_2() { _split 5.2; }
+
md5sums="4e7ec93678c760c4e42cea7d28aafa13 luafilesystem-1.6.2.tar.gz"