aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-07-14 22:25:48 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-07-14 22:26:21 +0200
commit26a988a13652109b041820ebc37d52cf3e73597f (patch)
tree562e43f7d36e12f7e959364a8456d7454e240576 /testing
parent3da808516c9f9f0916a8e7b623e789ec76d11073 (diff)
downloadaports-26a988a13652109b041820ebc37d52cf3e73597f.tar.bz2
aports-26a988a13652109b041820ebc37d52cf3e73597f.tar.xz
testing/lua-http: new aport
https://github.com/daurnimator/lua-http HTTP Library for Lua that supports HTTP(S) 1.0, 1.1 and 2.0
Diffstat (limited to 'testing')
-rw-r--r--testing/lua-http/APKBUILD60
1 files changed, 60 insertions, 0 deletions
diff --git a/testing/lua-http/APKBUILD b/testing/lua-http/APKBUILD
new file mode 100644
index 0000000000..049264ffaf
--- /dev/null
+++ b/testing/lua-http/APKBUILD
@@ -0,0 +1,60 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=lua-http
+pkgver=0.2
+pkgrel=0
+pkgdesc="HTTP Library for Lua that supports HTTP(S) 1.0, 1.1 and 2.0"
+url="https://github.com/daurnimator/lua-http"
+arch="noarch"
+license="MIT"
+depends="lua-cqueues lua-basexx lua-fifo lua-lpeg lua-lpeg_patterns lua-ossl"
+checkdepends="lua-busted lua-compat53 lua5.1-bit32"
+makedepends=""
+subpackages=""
+source="$pkgname-$pkgver.tar.gz::https://github.com/daurnimator/$pkgname/archive/v$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+# luajit is not available for selected arches
+case "$CARCH" in
+ s390x) _luajit="";;
+ *) checkdepends="$checkdepends luajit" _luajit="jit";;
+esac
+
+_luaversions="5.1 5.2 5.3"
+for _v in $_luaversions; do
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+ checkdepends="$checkdepends lua$_v"
+done
+
+check() {
+ cd "$builddir"
+
+ local lver; for lver in $_luaversions $_luajit; do
+ msg "Testing on lua$lver"
+ lua$lver /usr/bin/busted
+ done
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ depends="lua$lver ${depends//lua-/lua$lver-}"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+ local lmod_dir="$subpkgdir/usr/share/lua/$lver"
+
+ if [ "$lver" != "5.3" ]; then
+ depends="$depends lua$lver-compat5.3"
+ fi
+ if [ "$lver" = "5.1" ]; then
+ depends="$depends lua5.1-bit32"
+ fi
+
+ mkdir -p "$lmod_dir"
+ cp -r "$builddir"/http "$lmod_dir"/
+}
+
+sha512sums="ed71ac09277e8602e3d4954541f06c09ef444db20e5b4e39a17b9ed4893046b1442969902c0ba84fc4c3c922a6d1c8ebf853fceda261b12bf10ea9aa24389587 lua-http-0.2.tar.gz"