#!/usr/bin/make -f
#export DH_VERBOSE=1

export PYBUILD_DESTDIR=debian/bootstrap-vz
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/bootstrap-vz/ --install-scripts=/usr/share/bootstrap-vz/

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


override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -b html docs/ build/html


override_dh_auto_clean:
	dh_auto_clean
	rm -rf build/
	rm -rf *.egg-info/
	# Remove files cached by Sphinx
	find docs/plugins/ docs/providers/ docs/testing/system_test_providers/ -type f | egrep -v '(gitignore|index)' | xargs rm -f


override_dh_compress:
	# Files from the HTML documentation should not be compressed, as they may
	# render in broken links
	dh_compress --exclude "bootstrap-vz-doc/html/"


override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.rst
