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

export PYBUILD_NAME = tap

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

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

override_dh_auto_test:
	# The tests display messages according to the LANGUAGE, which
	# can vary, so we need to be using a value of LC_MESSAGES or
	# LC_ALL that can represent codepoints beyond ASCII.
	LC_ALL=C.UTF-8 dh_auto_test

override_dh_install:
	install -d $(CURDIR)/debian/tappy/usr/bin
	mv $(CURDIR)/debian/python3-tap/usr/bin/tappy $(CURDIR)/debian/tappy/usr/bin/
	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_auto_clean:
	dh_auto_clean
	make -C docs clean
