#!/usr/bin/make -f

export PYBUILD_NAME=virtualenv

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

override_dh_auto_configure:
	# Remove the embedded wheels in favor of the -whl packages.
	rm -f virtualenv_support/*.whl
	dh_auto_configure

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/news.rst
