# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-resty-http
pkgver=0.17.2
pkgrel=0
pkgdesc="Lua HTTP client cosocket driver for OpenResty / ngx_lua"
url="https://github.com/ledgetech/lua-resty-http"
arch="noarch"
license="BSD-2-Clause"
depends="lua"
source="$pkgname-$pkgver.tar.gz::https://github.com/ledgetech/lua-resty-http/archive/v$pkgver.tar.gz"
options="!check"  # FIXME: tests require OpenResty and additional dependencies

for _v in 5.1 5.2 5.3; do
	provides="$provides lua$_v-${pkgname#lua-}=$pkgver-r$pkgrel"  # for backward compatibility
done

package() {
	make install DESTDIR="$pkgdir" LUA_LIB_DIR="/usr/share/lua/common"

	echo 'rock_manifest = {}' > rock_manifest
	install -D -m 644 rock_manifest \
		"$pkgdir"/usr/lib/luarocks/rocks-common/$pkgname/$pkgver-1
}

sha512sums="
5e9aea2bad4a8c9002328d91ee06fe78fad98459a70cabb0ad070649a0a9926a5eca7528d318a2f8b629519e20057738952c0a27f737cd1dd0318524d5692bf3  lua-resty-http-0.17.2.tar.gz
"
