#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
export PBR_VERSION=$(DEB_VERSION_UPSTREAM)
export SKIP_PIP_INSTALL=1

VERBOSE=1
export PYBUILD_NAME=virtualenvwrapper

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_clean:
	rm -rf build *.egg-info

execute_after_dh_auto_build:
	python3 -m sphinx -b html -a -c docs/source -D language=en docs/source \
		build/html
	python3 -m sphinx -b man -a -c docs/source -D language=en docs/source \
		build/man

execute_after_dh_auto_install:
	# Remove bin files from Python packages
	rm -rv $(CURDIR)/debian/python3-virtualenvwrapper/usr/bin
	dh_bash-completion

override_dh_compress:
	dh_compress -i -X.rst -X.js -X.html -X.txt

override_dh_installchangelogs:
	dh_installchangelogs docs/source/history.rst

execute_after_dh_sphinxdoc:
	dh_sphinxdoc /usr/share/doc/virtualenvwrapper/html/
