#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_NAME=pystache

%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_installchangelogs:
	dh_installchangelogs $(CURDIR)/HISTORY.md

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3
	mv -f $(CURDIR)/debian/python3-pystache/usr/bin/pystache $(CURDIR)/debian/python3-pystache/usr/bin/pystache3
	find $(CURDIR)/debian -name pystache-test -type f -delete
	find $(CURDIR)/debian -name tests -type d | xargs rm -rf
	find $(CURDIR)/debian -name "HISTORY.md*" -delete

override_dh_auto_test:
	set -e ;\
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS="{interpreter} $(CURDIR)/pystache/commands/test.py" \
	dh_auto_test
