aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-resty-dns/APKBUILD
blob: d8bbc3c304a71ffe7c31953b42ac0266e16490d7 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
_luaversions="5.1"
pkgname=lua-resty-dns
pkgver=0.17
pkgrel=1
pkgdesc="DNS resolver for the nginx lua module"
url="https://github.com/openresty/lua-resty-dns"
arch="noarch"
license="BSD"
depends="nginx-mod-http-lua"
makedepends=""
install=""
subpackages=""
source="lua-resty-dns-$pkgver.tar.gz::https://github.com/openresty/lua-resty-dns/archive/v$pkgver.tar.gz
	add-naptr.patch"
builddir="$srcdir/lua-resty-dns-$pkgver"

for _v in $_luaversions; do
	subpackages="$subpackages lua${_v}-resty-dns:split_${_v/./_}"
done

build() {
	cd "$builddir"
}

package() {
	cd "$builddir"
	local _i
	for _i in $_luaversions; do
		mkdir -p "$pkgdir"/usr/share/lua/$_i
		make DESTDIR="$pkgdir" LUA_LIB_DIR="/usr/share/lua/$_i" install \
			|| return 1
	done
}

_split() {
	local d= _ver=$1
	pkgdesc="$pkgdesc for Lua $_ver"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends=
	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
}

for _v in $_luaversions; do
        eval "split_${_v/./_}() { _split $_v; }"
done

md5sums="ebbc3dc086a3991a707b6a145657b489  lua-resty-dns-0.17.tar.gz
9b286e97c8f09334793b411eacc4eecd  add-naptr.patch"
sha256sums="586740cd3eff66cb9e57747dcc000831c8a7988128e80b8b17f691bfe01e510e  lua-resty-dns-0.17.tar.gz
10a8d351fd87468dd680f43645f5b3117a5929b67f6d0f5d6d9649ce5da04c58  add-naptr.patch"
sha512sums="5c9d7291b90f95694a9b1d4f12fcd94d30ff3d918f0942af93c02a26c794f86e1b458faccbba9cc5ec879a43ec24a7c8fdb2e5ac4f4ce7376576f33f606b0d1a  lua-resty-dns-0.17.tar.gz
e30849f3c45d8ca4aceae312a5e66566d70e6eaee81a622de3837b8d46f4f953ffd2ddd0c8f37ebeecf8d929518967a1252d2593b041cfa16a4f971b17d8a0cc  add-naptr.patch"