diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2020-02-23 00:33:53 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2020-02-23 01:01:28 +0100 |
commit | 14e65cdcde3c3d3cf04f041c4fb40bd29119635e (patch) | |
tree | 8fbeb8522591f93f08e8ba39032c16ef26e4a075 /community | |
parent | e0d9cb9d6eeb3d5b4e27c091209acedef80f1d9a (diff) | |
download | aports-14e65cdcde3c3d3cf04f041c4fb40bd29119635e.tar.bz2 aports-14e65cdcde3c3d3cf04f041c4fb40bd29119635e.tar.xz |
community/lua-mmdb: new aport (needed for knot-resolver)
Diffstat (limited to 'community')
-rw-r--r-- | community/lua-mmdb/APKBUILD | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/community/lua-mmdb/APKBUILD b/community/lua-mmdb/APKBUILD new file mode 100644 index 0000000000..c80c5f8c9b --- /dev/null +++ b/community/lua-mmdb/APKBUILD @@ -0,0 +1,70 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +pkgname=lua-mmdb +_rockname=mmdblua +# Keep in sync with project's submodule. +_maxmind_gitrev=f4149c9fb5897f8dd40946ed5f70768033b4f571 +pkgver=0.2 +pkgrel=0 +pkgdesc="Maxmind database parser for lua" +url="https://github.com/daurnimator/mmdblua" +arch="noarch" +license="MIT" +depends="lua" +checkdepends="lua-busted lua5.1-compat53 lua5.2-compat53" +subpackages="" +source="https://github.com/daurnimator/mmdblua/archive/v$pkgver/$pkgname-$pkgver.tar.gz + https://github.com/maxmind/MaxMind-DB/archive/$_maxmind_gitrev/MaxMind-DB-$_maxmind_gitrev.tar.gz + " +builddir="$srcdir/$_rockname-$pkgver" + +case "$CARCH" in + # luajit is not available for s390x + 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 lua$_v-busted" +done + +prepare() { + default_prepare + + rmdir spec/MaxMind-DB + ln -s ../../MaxMind-DB-$_maxmind_gitrev spec/MaxMind-DB +} + +check() { + local lver; for lver in $_luaversions $_luajit; do + msg "Testing on lua$lver" + LUA_PATH='?/init.lua;;' lua$lver /usr/bin/busted + done +} + +package() { + mkdir -p "$pkgdir" +} + +_subpackage() { + local lver="${subpkgname:3:3}" + pkgdesc="$pkgdesc $lver" + install_if="$pkgname=$pkgver-r$pkgrel lua$lver" + local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_rockname/$pkgver-0" + + depends="lua$lver" + case "$lver" in + 5.1 | 5.2) depends="$depends lua$lver-compat53";; + esac + + install -m 644 -D "$builddir"/mmdb/init.lua \ + "$subpkgdir"/usr/share/lua/$lver/mmdb.lua + + mkdir -p "$rockdir" + echo 'rock_manifest = {}' > "$rockdir"/rock_manifest +} + +sha512sums="f45dbff51fbf04f11d4cc7592aae4cc72c38a421476cb2c37829fd2c59953148f012ad977251b8c5f9a358d7dc7acbf2abd3bf9f11b0d018d1297831a0bd80e1 lua-mmdb-0.2.tar.gz +57a5cc563db20eba15c7cdefcab8f9c1d21bf00e36b042c71d610ceb00e6b548651d8b3b54f03f537f05303286fd92d18c2f8c757293f7e32b46dabcd883d274 MaxMind-DB-f4149c9fb5897f8dd40946ed5f70768033b4f571.tar.gz" |