#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export PYBUILD_NAME=maxminddb

export SETUPTOOLS_SCM_PRETEND_VERSION = $(DEB_VERSION_UPSTREAM)

# use the system copy rather than the embedded libmaxminddb copy
export MAXMINDDB_USE_SYSTEM_LIBMAXMINDDB=1

%:
	dh $@ --buildsystem=pybuild

ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
execute_before_dh_auto_build:
	PYTHONPATH=.:$$PYTHONPATH sphinx-build -b html -d .build/.doctrees -N docs .build/html
endif
