diff options
Diffstat (limited to 'main/lua-filesystem')
-rw-r--r-- | main/lua-filesystem/APKBUILD | 56 |
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" |