# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: frank AT apsu DOT be
pkgname=(libmaxminddb mmdblookup)
pkgver=1.12.2
pkgrel=2
pkgdesc="MaxMind GeoIP2 database - split package with library and utilities"
license=('Apache-2.0')
arch=('x86_64' 'armv7h')
url="https://maxmind.github.io/libmaxminddb/"
optdepends=('geoip2-database: IP geolocation databases')
source=("https://github.com/maxmind/libmaxminddb/releases/download/$pkgver/libmaxminddb-$pkgver.tar.gz")
sha256sums=('1bfbf8efba3ed6462e04e225906ad5ce5fe958aa3d626a1235b2a2253d600743')
build() {
cd "$srcdir"/libmaxminddb-$pkgver
./configure --prefix=/usr
make
}
check() {
cd "$srcdir"/libmaxminddb-$pkgver
make check
}
package_libmaxminddb() {
pkgdesc="MaxMindDB GeoIP2 database library"
depends=('glibc')
cd "$srcdir"/libmaxminddb-$pkgver
make PREFIX=/usr DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/usr/{bin,share/man/man1}
}
package_mmdblookup() {
pkgdesc="MaxMindDB GeoIP2 lookup utility"
url="https://maxmind.github.io/libmaxminddb/mmdblookup.html"
depends=('libmaxminddb')
cd "$srcdir"/libmaxminddb-$pkgver
make PREFIX=/usr DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/usr/{lib,include,share/man/man3}
}