#!/usr/bin/make -f

VERS=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
export DH_VERBOSE=1
export PYBUILD_DESTDIR=debian/tmp
export PYBUILD_DISABLE_python2=1

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

override_dh_python3:
	dh_python3 --ignore-shebangs

override_dh_missing:
	rm -r `find debian/tmp -name __pycache__`
	dh_missing --fail-missing

get-orig-source:
	python3 ./setup.py sdist
	cp dist/*.tar.gz ../probert_${VERS}.orig.tar.gz
	cp dist/*.tar.gz /tmp/probert_${VERS}.orig.tar.gz
	rm -rf dist
