Commit 26a988a1 authored by Jakub Jirutka's avatar Jakub Jirutka

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
parent 3da80851
# 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"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment