#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export PYBUILD_NAME=sphinxcontrib.datatemplates
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_

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


execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep:
	#echo "glob_sortkey = lambda p: p.absolute()" >> doc/source/conf.py
	#echo "html_search = False" >> doc/source/conf.py
	export LANG=C; \
	export LANGUAGE=C; \
	export SPHINXOPTS="-D language=en" ; \
	python3 -m sphinx -N -bhtml \
	doc/source/ html/ # HTML generator
	#cp debian/searchindex.js html/searchindex.js

override_dh_auto_clean:
	dh_auto_clean
	rm -f sphinxcontrib/datatemplates/version.py
	rm -rf html
