#!/usr/bin/make -f

# DH_VERBOSE := 1
export LC_ALL=C.UTF-8

include /usr/share/dpkg/default.mk

%:
	dh $@ --buildsystem=pybuild

override_dh_install:
	dh_install
	mv debian/$(DEB_SOURCE)/usr/bin/tpp debian/$(DEB_SOURCE)/usr/bin/transit-tpp

# Upstream tarball contains a dangling symlink to local data file - hack around this
override_dh_auto_configure:
	mkdir -p tests_invalid_data
	if [ -L tests/H37Rv.fna ] && ! [ -e tests/H37Rv.fna ] \
	; then mv tests/H37Rv.fna tests_invalid_data \
	; fi
	dh_auto_configure

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test -- --system=custom --test-args="PYTHONPATH=tests {interpreter} -m unittest -v tests/*.py"
endif


override_dh_auto_clean:
	dh_auto_clean
	rm -rf tests_invalid_data
	rm -rf tnseq_transit.egg-info
