diff options
Diffstat (limited to 'testing/luarocks')
-rw-r--r-- | testing/luarocks/APKBUILD | 69 |
1 files changed, 32 insertions, 37 deletions
diff --git a/testing/luarocks/APKBUILD b/testing/luarocks/APKBUILD index 390978bb2e..f8f3eff31e 100644 --- a/testing/luarocks/APKBUILD +++ b/testing/luarocks/APKBUILD @@ -2,47 +2,43 @@ # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=luarocks pkgver=2.3.0 -_lua_versions="5.1 5.2 5.3" pkgrel=1 pkgdesc="Deployment and management system for Lua modules" url="http://www.luarocks.org/" arch="noarch" license="MIT" depends="curl" -depends_dev="" -makedepends="$depends_dev" -install="" +makedepends="" subpackages="" source="http://luarocks.org/releases/$pkgname-$pkgver.tar.gz" +builddir="$srcdir/$pkgname-$pkgver" + +_lua_versions="5.1 5.2 5.3" for _v in $_lua_versions; do - makedepends="$makedepends lua$_v-dev lua$_v" - subpackages="$subpackages ${pkgname}${_v}:split_${_v/./_}" + makedepends="$makedepends lua$_v-dev" + subpackages="$subpackages $pkgname${_v}:_package" done -_builddir="$srcdir"/luarocks-$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 - # create builddir for each lua version - for _ver in $_lua_versions; do - cp -r $_builddir "$srcdir"/$pkgname-$_ver + default_prepare || return 1 + + # Create builddir for each Lua version. + local lver; for lver in $_lua_versions; do + cp -r "$builddir" "$builddir-$lver" done } build() { - for _ver in $_lua_versions; do - cd "$srcdir"/$pkgname-$_ver + local lver; for lver in $_lua_versions; do + cd "$builddir-$lver" + ./configure \ --prefix=/usr \ --sysconfdir=/etc/luarocks \ - --lua-version=$_ver \ - --lua-suffix=$_ver \ + --lua-version="$lver" \ + --lua-suffix="$lver" \ --with-downloader=curl \ + --with-md5-checker=md5sum \ --versioned-rocks-dir \ || return 1 make || return 1 @@ -53,26 +49,25 @@ package() { mkdir -p "$pkgdir" } -_split() { - local _ver="$1" - cd "$srcdir"/$pkgname-$_ver - pkgdesc="Deployment and management system for Lua $_ver modules" - install_if="lua$_ver $pkgname=$pkgver-r$pkgrel" - depends="lua$_ver" +_package() { + local lver="${subpkgname#$pkgname}" + pkgdesc="Deployment and management system for Lua $lver modules" + install_if="lua$lver $pkgname=$pkgver-r$pkgrel" + depends="lua$lver" + + cd "$builddir-$lver" + make install DESTDIR="$subpkgdir" || return 1 - # remove default script names which conflict per lua version + + # Remove default script names which conflict per Lua version. rm "$subpkgdir"/usr/bin/luarocks \ "$subpkgdir"/usr/bin/luarocks-admin || return 1 - # set the correct lua version - sed -i "s/env lua/env lua${_ver}/" \ - "$subpkgdir"/usr/bin/luarocks-${_ver} \ - "$subpkgdir"/usr/bin/luarocks-admin-${_ver} || return 1 -} -# call split function for each lua version -for _v in $_lua_versions; do - eval "split_${_v/./_}() { _split $_v; }" -done + # Set the correct Lua version. + sed -i "s/env lua/env lua${lver}/" \ + "$subpkgdir"/usr/bin/luarocks-$lver \ + "$subpkgdir"/usr/bin/luarocks-admin-$lver +} md5sums="a38126684cf42b7d0e7a3c7cf485defb luarocks-2.3.0.tar.gz" sha256sums="68e38feeb66052e29ad1935a71b875194ed8b9c67c2223af5f4d4e3e2464ed97 luarocks-2.3.0.tar.gz" |