#!/usr/bin/make -f

#DH_VERBOSE = 1
#include /usr/share/dpkg/default.mk

export LC_ALL=C.UTF-8

export NOSE_VERBOSE=2
export PYBUILD_NAME=bx-python
export PYBUILD_BEFORE_TEST=export PYTHONPATH={install_dir} ; cp -r {dir}/test_data {build_dir}/
export PYBUILD_AFTER_TEST=rm -Rf {build_dir}/test_data
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_clean:
	dh_auto_clean
# C files are generated by Cython
	find -name "*.pyx" | sed 's/pyx$$/c/' | xargs $(RM)
	grep -rli "Generated by Cython" lib/ | xargs -r rm
# Changes perpetually redone
	rm -rf lib/bx_python.egg-info

before-pybuild-autopkgtest:
	find lib -name "*_tests.py" > debian/pybuild.testfiles
	echo pytest.ini >> debian/pybuild.testfiles

after-pybuild-autopkgtest:
	rm debian/pybuild.testfiles

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3
	dh_numpy3
