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

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

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. http_proxy='http://127.0.0.1:9/' python3 -m sphinx -N -bhtml docs/ debian/html

#fix privacy-breach-generic
override_dh_link:
	dh_link
	find debian/python-domain2idna-doc/ -name '*.html' -exec sed -i 's|src="https:||g' {} \;

# Move /usr/bin/domain2idna from python3-domain2idna to domain2idna, drop all other scripts
override_dh_install:
	dh_install
	mkdir -p $(CURDIR)/debian/domain2idna/usr/bin/
	mv $(CURDIR)/debian/python3-domain2idna/usr/bin/domain2idna $(CURDIR)/debian/domain2idna/usr/bin/
	rm -rf $(CURDIR)/debian/python3-domain2idna/usr/bin/
