aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-resty-http/APKBUILD
blob: 7530bd8b759f38c5fd9d0d59809716cb545fc5f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-resty-http
pkgver=0.11
pkgrel=0
pkgdesc="Lua HTTP client cosocket driver for OpenResty / ngx_lua"
url="https://github.com/pintsized/lua-resty-http"
arch="noarch"
license="BSD2"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/pintsized/lua-resty-http/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"
options="!check"

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

package() {
	mkdir -p "$pkgdir"
}

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (Lua $lver)"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$pkgname/$pkgver-1"

	cd "$builddir"
	make install DESTDIR="$subpkgdir" LUA_LIB_DIR="/usr/share/lua/$lver"

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="8cf7bfccba3f1f705e287c2ee5cd86bdacb5f236ab936db6992b4bf176567535d6e642b5d6c70672afd3e82b7cde9c8303ad24f5250f22bf5b4e69d325c12a6c  lua-resty-http-0.11.tar.gz"