#!/usr/bin/make -f

export DH_VERBOSE=1
export PYBUILD_VERBOSE=1
export PYBUILD_NAME=virtualenv

export DIRTBIKE_DIRECTORY=\
    $(CURDIR)/debian/virtualenv/usr/share/python-wheels


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

# The upstream tarball doesn't include enough to run the tests.
override_dh_auto_test:

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

override_dh_python2:
	dh_python2
	# No Python 2 cli script.
	rm -rf debian/python-virtualenv/usr/bin

override_dh_auto_install:
	dh_auto_install
	# Use the separate binary package for the cli script.
	mkdir -p debian/virtualenv/usr/bin
	mv debian/python3-virtualenv/usr/bin/virtualenv \
	   debian/virtualenv/usr/bin
	rm -rf debian/python3-virtualenv/usr/bin

override_dh_installchangelogs:
	dh_installchangelogs docs/changes.rst
