#!/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

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build *.egg-info

override_dh_auto_build:
	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

override_dh_auto_install:
	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 ChangeLog

override_dh_sphinxdoc:
	dh_sphinxdoc -X searchtools.js -X translations.js
	dh_sphinxdoc /usr/share/doc/virtualenvwrapper/html/

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