diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-07-23 15:07:03 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-07-23 15:08:58 +0000 |
commit | c975a1164f46c45a7d61b5e12e7a55e1375df527 (patch) | |
tree | 939f74ddcfb722fa54fe7deaccef49e1097c67ab /main/lua-crypto | |
parent | b7cedfd50a6dbb773a0b308ec6eb678b4cd4e457 (diff) | |
download | aports-c975a1164f46c45a7d61b5e12e7a55e1375df527.tar.bz2 aports-c975a1164f46c45a7d61b5e12e7a55e1375df527.tar.xz |
main/lua-crypto: build for multiple lua versions
merge in lua5.2-crypto as subpackage
Diffstat (limited to 'main/lua-crypto')
-rw-r--r-- | main/lua-crypto/APKBUILD | 63 |
1 files changed, 49 insertions, 14 deletions
diff --git a/main/lua-crypto/APKBUILD b/main/lua-crypto/APKBUILD index c95a44a2dd..7e2370cbd9 100644 --- a/main/lua-crypto/APKBUILD +++ b/main/lua-crypto/APKBUILD @@ -1,16 +1,20 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> -_luaver=5.1 +_luaversions="5.1 5.2 5.3" pkgname=lua-crypto pkgver=0.3.2 -pkgrel=0 +pkgrel=1 pkgdesc="a Lua frontend to the OpenSSL cryptographic library" url="http://mkottman.github.io/luacrypto/" arch="all" license="MIT/X11" depends= -makedepends="lua$_luaver-dev openssl-dev" +makedepends="openssl-dev" install= subpackages="$pkgname-dev $pkgname-doc" +for _v in $_luaversions; do + makedepends="$makedepends lua$_v-dev" + subpackages="$subpackages lua$_v-crypto:split_${_v/./_}" +done source="luacrypto-$pkgver.tar.gz::https://github.com/mkottman/luacrypto/archive/$pkgver.tar.gz" _builddir="$srcdir"/luacrypto-$pkgver @@ -18,26 +22,57 @@ _builddir="$srcdir"/luacrypto-$pkgver prepare() { cd "$_builddir" update_config_sub || return 1 + for i in $_luaversions; do + mkdir -p build-$i + done } build() { cd "$_builddir" - LUA_CFLAGS="$(pkg-config lua$_luaver --cflags)" \ - LUA_LIBS="$(pkg-config lua$_luaver --libs)" \ - ./configure \ - --host=$CHOST \ - --build=$CBUILD \ - --prefix=/usr \ - || return 1 - make cryptodir=/usr/lib/lua/$_luaver || return 1 + for i in $_luaversions; do + msg "build for Lua $i" + cd build-$i + LUA_CFLAGS="$(pkg-config lua$i --cflags)" \ + LUA_LIBS="$(pkg-config lua$i --libs)" \ + ../configure \ + --host=$CHOST \ + --build=$CBUILD \ + --prefix=/usr \ + || return 1 + make cryptodir=/usr/lib/lua/$_luaver || return 1 + cd .. + done } package() { cd "$_builddir" - make install DESTDIR="$pkgdir" cryptodir=/usr/lib/lua/$_luaver \ - || return 1 - find "$pkgdir" -name '*.la' -delete + for i in $_luaversions; do + cd build-$i + make install DESTDIR="$pkgdir" cryptodir=/usr/lib/lua/$i \ + || return 1 + find "$pkgdir" -name '*.la' -delete + cd .. + done } +_split() { + local d= _ver=$1 + pkgdesc="$pkgdesc for Lua $_ver" + install_if="lua$_ver $pkgname=$pkgver-r$pkgrel" + depends= + 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 _v in $_luaversions; do + eval "split_${_v/./_}() { _split $_v; }" +done + + md5sums="07271929beec760a42eff012803490a1 luacrypto-0.3.2.tar.gz" sha256sums="63c5d7e2539779039114335b9a8f149d63382c4db298d69e70488a0108143bb4 luacrypto-0.3.2.tar.gz" sha512sums="4cb20d2cc348a11f140210dffb803629034c72cc7232590f4488f559d5c7233e0c41e56fcd0863959ac0b07e64c9aa79ea573e4126fdc11bc3f1b3b49d13343e luacrypto-0.3.2.tar.gz" |