aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-maxminddb/APKBUILD
blob: 5ce2a0a63007336cc55c46b6eff0964e7721e0d7 (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
60
61
# Maintainer: Timo Teräs <timo.teras@iki.fi>
_luaversions="5.1 5.2"

pkgname=lua-maxminddb
pkgver=0.1
pkgrel=0
pkgdesc="libmaxminddb bindings for Lua"
url="https://github.com/fabled/lua-maxminddb"
arch="all"
license="MIT"
depends=""
makedepends="libmaxminddb-dev"
subpackages=
for _i in $_luaversions; do
	depends="$depends lua$_i-maxminddb"
        makedepends="$makedepends lua$_i-dev"
        subpackages="$subpackages lua$_i-maxminddb:_maxminddb_${_i/./_}"
done
install=
source="$pkgname-$pkgver.tar.gz::https://github.com/fabled/lua-maxminddb/archive/v$pkgver.tar.gz"

_builddir="$srcdir"/lua-maxminddb-$pkgver

prepare() {
	cd "$_builddir"
	# apply patches here
	for _i in $_luaversions; do
		cp -a "$_builddir" "$srcdir"/build-$_i || return 1
	done
}

build() {
	cd "$_builddir"
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		msg "build for Lua $_i"
		make LUA_PKG="lua$_i" \
			|| return 1
        done
}

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

_split_maxminddb() {
	local _ver=$1
	pkgdesc="$pkgdesc $_ver"
	depends=""

	cd "$srcdir"/build-$_ver
	make install LUA_PKG="lua$_ver" DESTDIR="$subpkgdir"
}

for _i in $_luaversions; do
	eval "_maxminddb_${_i/./_}() { _split_maxminddb $_i; }"
done

md5sums="4dc1537c7f8064535868eacc4a5bd757  lua-maxminddb-0.1.tar.gz"
sha256sums="414f5eaa818932bc1cbaa7f27dbde31b3e813d75851e468dd1606f2a89373f8b  lua-maxminddb-0.1.tar.gz"
sha512sums="37fb3e37e24dd6188a1d38945056acd8444d0963af5c53b3c3af51f02130d0eeeb2d32428fae9e75f55db49b7caefe557389f93e27208729222b1a91e63dff0a  lua-maxminddb-0.1.tar.gz"