# Maintainer: Natanael Copa _luaversions="5.1 5.2" _defaultlua="5.1" pkgname=lua-filesystem pkgver=1.6.2 pkgrel=2 pkgdesc="Filesystem functions for Lua" url="http://www.keplerproject.org/luafilesystem/" arch="all" license="GPL" depends="lua$_defaultlua-filesystem" install= 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" _sdir="$srcdir"/luafilesystem-$pkgver prepare() { cd "$_sdir" # apply patches here cd "$srcdir" for _i in $_luaversions; do cp -r "$_sdir" "$srcdir"/build-$_i done } build() { for _i in $_luaversions; do cd "$srcdir"/build-$_i make CFLAGS="$CFLAGS $( pkg-config lua$_i --cflags ) -fPIC" \ || return 1 done } package() { 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" replaces="$pkgname" 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 } for _i in $_luaversions; do eval "split_${_i/./_}() { _split $_i; }" done md5sums="4e7ec93678c760c4e42cea7d28aafa13 luafilesystem-1.6.2.tar.gz"