# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-maxminddb
pkgver=2.6.2
pkgrel=0
pkgdesc="Python MaxMind DB reader extension"
url="https://maxminddb.readthedocs.io/en/latest/"
arch="all"
license="Apache-2.0"
depends="python3"
makedepends="libmaxminddb-dev python3-dev py3-setuptools py3-wheel"
checkdepends="py3-nose py3-mock"
_test_data_commit=86095bd9855d6313c501fe0097891a3c6734ae90
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/maxmind/MaxMind-DB-Reader-python/archive/v$pkgver.tar.gz
	MaxMind-DB-test-data-$_test_data_commit.tar.gz::https://github.com/maxmind/MaxMind-DB/archive/$_test_data_commit.tar.gz
	"

builddir="$srcdir/MaxMind-DB-Reader-python-$pkgver"

prepare() {
	cd "$srcdir"

	# Submodule required for tests
	cp -r "MaxMind-DB-$_test_data_commit/"* "$builddir/tests/data"

	default_prepare
}

build() {
	python3	setup.py build
}

check() {
	python3	setup.py test
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
bcbe92b2949a042e2199c1241ae0f4098bf69c905635fc5397454212a180927c03de9e96f0099626df93fccc0ab3760b45db52004005107c5f40532b6f85e6e2  py3-maxminddb-2.6.2.tar.gz
537423532e4d61aa5d207199498a9354d0ea8322af3b66521b6e3fb1fdfbddd82bfeb19781fead84a028c01713c7784f059e6b279799a7cf5aa42502a31ff7c4  MaxMind-DB-test-data-86095bd9855d6313c501fe0097891a3c6734ae90.tar.gz
"
