aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-sec/APKBUILD
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-07-09 15:03:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-07-09 15:03:57 +0000
commit0b0243aac8a73b3f1036202dd2d3b8f0339d53b1 (patch)
treea3675636f2ffaedc7253508d58133e435748932d /main/lua-sec/APKBUILD
parent5c5253cddf466b4787f7e7963fd211e2be95f5ee (diff)
downloadaports-0b0243aac8a73b3f1036202dd2d3b8f0339d53b1.tar.gz
aports-0b0243aac8a73b3f1036202dd2d3b8f0339d53b1.tar.bz2
aports-0b0243aac8a73b3f1036202dd2d3b8f0339d53b1.tar.xz
main/lua-sec: upgrade to 0.5 and add support for lua 5.2
Diffstat (limited to 'main/lua-sec/APKBUILD')
-rw-r--r--main/lua-sec/APKBUILD79
1 files changed, 58 insertions, 21 deletions
diff --git a/main/lua-sec/APKBUILD b/main/lua-sec/APKBUILD
index 8d8cf95cf1..fb4f0d1f40 100644
--- a/main/lua-sec/APKBUILD
+++ b/main/lua-sec/APKBUILD
@@ -1,40 +1,77 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
+_luaversions="5.1 5.2"
pkgname=lua-sec
-_name=luasec
-pkgver=0.4
-pkgrel=1
+pkgver=0.5
+pkgrel=0
pkgdesc="TLS/SSL Support for Lua"
-url="http://www.inf.puc-rio.br/~brunoos/luasec/"
+url="https://github.com/brunoos/luasec/wiki"
arch="all"
license="MIT"
-depends="lua-socket"
-makedepends="lua-dev openssl-dev"
+depends=
+makedepends="openssl-dev"
install=
subpackages="$pkgname-doc"
-source="http://www.inf.puc-rio.br/~brunoos/luasec/download/luasec-$pkgver.tar.gz"
+for _i in $_luaversions; do
+ depends="$depends lua$_i-sec"
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-sec:split_${_i/./_}"
+done
-_builddir="$srcdir"/$_name-$pkgver
+source="luasec-$pkgver.tar.gz::https://github.com/brunoos/luasec/archive/luasec-$pkgver.tar.gz"
+_builddir="$srcdir"/luasec-luasec-$pkgver
prepare() {
- cd "$_builddir"
+ cd "$srcdir"
+ for _i in $_luaversions; do
+ cp -r "$srcdir"/luasec-luasec-$pkgver build-$_i
+ done
}
build() {
- cd "$_builddir"
- make linux || return 1
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ make linux INC_PATH="$(pkg-config --cflags lua$_i)" \
+ LD="${CC:-gcc}" || return 1
+ done
}
package() {
- _luasharedir=/usr/share/lua/5.1
- _lualibdir=/usr/lib/lua/5.1
- cd "$_builddir"
- mkdir -p "$pkgdir"/$_luasharedir "$pkgdir"/$_lualibdir
- make LUAPATH="$pkgdir"/$_luasharedir \
- LUACPATH="$pkgdir"/$_lualibdir \
- install
- mkdir -p "$pkgdir"/usr/share/doc/$pkgname
- cp -r samples "$pkgdir"/usr/share/doc/$pkgname/
+ for _i in $_luaversions; do
+ _luasharedir=/usr/share/lua/$_i
+ _lualibdir=/usr/lib/lua/$_i
+ cd "$srcdir"/build-$_i
+ mkdir -p "$pkgdir"/$_luasharedir "$pkgdir"/$_lualibdir
+ make LUAPATH="$pkgdir"/$_luasharedir \
+ LUACPATH="$pkgdir"/$_lualibdir \
+ install
+ if ! [ -d "$pkgdir"/usr/share/doc/$pkgname/sambles ]; then
+ mkdir -p "$pkgdir"/usr/share/doc/$pkgname
+ cp -r samples "$pkgdir"/usr/share/doc/$pkgname/ \
+ || return 1
+ fi
+ done
+}
+
+_split() {
+ local d= _ver=$1
+ pkgdesc="TLS/SSL Support for Lua $_ver"
+ replaces="$pkgname"
+ depends="lua$_ver-socket"
+ 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
}
-md5sums="712158d60207bdbb6215fc7e07d8db24 luasec-0.4.tar.gz"
+for _i in $_luaversions; do
+ eval "split_${_i/./_}() { _split $_i; }"
+done
+
+
+md5sums="0518f4524f399f33424c6f450e1d06db luasec-0.5.tar.gz"
+sha256sums="6480598f7492ac479b6b608b5fb1488226bfa6ef675e29f6b24dbe9099083523 luasec-0.5.tar.gz"
+sha512sums="fcf88f2566952c4d12be95531991180a1f3bd60f7dda41997f93c80ccc8d9dfd44b00e3330a07e451489dc9cd0640f7841101c10867e270608187df78549fe2f luasec-0.5.tar.gz"