#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

export PYBUILD_NAME=pyproj

# Path to system installed Proj.4 data.
export PROJ_DIR=/usr/

%:
	dh $@ \
		--with python2,python3 \
		--buildsystem=pybuild \
		--parallel

override_dh_clean:
	dh_clean lib/pyproj/data/FL lib/pyproj/data/MD \
	         lib/pyproj/data/TN lib/pyproj/data/WI \
	         lib/pyproj/data/WO \
	         lib/pyproj/data/alaska lib/pyproj/data/conus \
	         lib/pyproj/data/hawaii lib/pyproj/data/null \
	         lib/pyproj/data/prvi lib/pyproj/data/stgeorge \
	         lib/pyproj/data/stlrnc lib/pyproj/data/stpaul \
	         nad2bin nad2bin.o \
	         src/pj_malloc.o

override_dh_auto_test:
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS="PYTHONPATH={build_dir} {interpreter} unittest/test.py -v" dh_auto_test || echo "Ignoring test failures"

override_dh_install:
	dh_install --list-missing

override_dh_python2:
	dh_python2 -ppython-pyproj

override_dh_python3:
	dh_python3 -ppython3-pyproj

