diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2015-07-23 11:46:26 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2015-07-23 11:46:30 +0200 |
commit | 5bf3a4262eabe78953cd73be2ec30ed84336b022 (patch) | |
tree | d3bf559dfdac88845aa4712f3309dc0b21afba35 /testing | |
parent | 44527e952c0ae3aad0b201723d3bce99632b1575 (diff) | |
download | aports-5bf3a4262eabe78953cd73be2ec30ed84336b022.tar.bz2 aports-5bf3a4262eabe78953cd73be2ec30ed84336b022.tar.xz |
testing/luarocks: new aport
Diffstat (limited to 'testing')
-rw-r--r-- | testing/luarocks/APKBUILD | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/testing/luarocks/APKBUILD b/testing/luarocks/APKBUILD new file mode 100644 index 000000000..ff6fe1b67 --- /dev/null +++ b/testing/luarocks/APKBUILD @@ -0,0 +1,79 @@ +# Contributor: Carlo Landmeter <clandmeter@gmail.com> +# Maintainer: +pkgname=luarocks +pkgver=2.2.2 +_lua_versions="5.1 5.2 5.3" +pkgrel=0 +pkgdesc="Deployment and management system for Lua modules" +url="http://www.luarocks.org/" +arch="noarch" +license="custom" +depends="" +depends_dev="" +makedepends="$depends_dev" +install="" +subpackages="" +source="luarocks-$pkgver.tar.gz::https://github.com/keplerproject/luarocks/archive/v$pkgver.tar.gz" +for _v in $_lua_versions; do + makedepends="$makedepends lua$_v-dev lua$_v" + subpackages="$subpackages ${pkgname}${_v}:split_${_v/./_}" +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 + done +} + +build() { + for _ver in $_lua_versions; do + cd "$srcdir"/$pkgname-$_ver + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc/luarocks \ + --lua-version=$_ver \ + --lua-suffix=$_ver \ + --with-downloader=curl \ + --versioned-rocks-dir \ + || return 1 + make || return 1 + done +} + +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" + make install DESTDIR="$subpkgdir" || return 1 + # 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 + +md5sums="ae321877b125c222640c548678d8997e luarocks-2.2.2.tar.gz" +sha256sums="ca3b6927756201f4dfe24812a124d2f77cf624534655baf316bbf2152fa59acc luarocks-2.2.2.tar.gz" +sha512sums="6332b2802ca7814db54a0bb3ff4a72b958ea2c2a29d05c9e023431a2d323d64eb63f01279793b6a8a2b624031835b27b5930937fe282b6dd6b291a236342fc28 luarocks-2.2.2.tar.gz" |