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

export PYBUILD_NAME = tap

# main packaging script based on dh7 syntax
%:
	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild


override_dh_auto_build:
	python3 setup.py compile_catalog
	dh_auto_build
	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bhtml docs/ build/html # HTML generator
	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bman docs/ build/man # HTML generator


override_dh_install:
	install -d $(CURDIR)/debian/tappy/usr/bin
	mv $(CURDIR)/debian/python3-tap/usr/bin/tappy $(CURDIR)/debian/tappy/usr/bin/
	rm -f $(CURDIR)/debian/python-tap/usr/bin/tappy
	dh_install -O--buildsystem=pybuild
	# Avoid namespace-grab, and file conflict with node-tap
	rm -f debian/*/usr/bin/tap


override_dh_sphinxdoc:
	dh_sphinxdoc -p python-tap-doc

override_dh_installchangelogs:
	dh_installchangelogs -O--buildsystem=pybuild docs/releases.rst

override_dh_auto_clean:
	dh_auto_clean
	make -C docs clean
