#!/usr/bin/make -f

# DH_VERBOSE := 1

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/default.mk

export PYBUILD_NAME=unicycler

# copy all nacessary data before testing and make clean after the testing
export PYBUILD_BEFORE_TEST=cp -a unicycler-runner.py {build_dir}; \
	cp -a unicycler/cpp_functions.so {build_dir}/unicycler; \
	cp -a sample_data {build_dir}
export PYBUILD_AFTER_TEST=rm {build_dir}/unicycler-runner.py; \
	rm -r {build_dir}/sample_data; \
	rm -r {build_dir}/unicycler/__pycache__

# Set $TEMR to a known value to avoid "tput: No value for $TERM and no -T specified"
export TERM=linux

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_clean:
	find . -name __pycache__ -type d | xargs rm -rf
	make distclean

override_dh_auto_build:
	make
	dh_auto_build

override_dh_auto_install:
	dh_auto_install --destdir=debian/$(PYBUILD_NAME)

override_dh_python3:
	dh_python3 --no-ext-rename
