#!/usr/bin/make -f

PKG := github.com/oschwald/maxminddb-golang/v2

# maxminddb-gen tests fail for mysterious reasons. In any case, IIUC, this is a
# tool aimed for developement, so not something that we need to build nor
# install in the -dev package.
export DH_GOLANG_EXCLUDES := maxminddb-gen

# Some tests need the top-level README.md
export DH_GOLANG_INSTALL_EXTRA := README.md

%:
	dh $@ --builddirectory=_build --buildsystem=golang

execute_after_dh_auto_configure:
	# Cleanup a bit under testdata, we don't need everything in there
	cd _build/src/$(PKG)/testdata/ \
	&& rm -fr .github/ cmd/ docs/ pkg/ source-data/ \
	&& { rm -f * .* || true; }
