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

export PYBUILD_NAME=opcodes


%:
	dh $@ -Spybuild --with python3,sphinxdoc

execute_after_dh_auto_clean:
	-$(RM) -rf sphinx/html opcodes.egg-info

execute_after_dh_auto_build:
	python3 -m sphinx sphinx sphinx/html

override_dh_installdocs:
	dh_installdocs --doc-main-package=python3-opcodes -ppython-opcodes-doc
	dh_installdocs -ppython3-opcodes

execute_after_dh_installdocs:
	-find debian -type f,l -name '*.js' -delete
	-find debian -type d -name 'bootstrap*' -exec $(RM) -rf '{}' \;
	-find debian -type d -name 'bootswatch*' -exec $(RM) -rf '{}' \;
	-find debian -type f -name '*doctree*' -delete
	-find debian -type d -name '.doctrees' -exec $(RM) -rf '{}' \;

execute_before_dh_link:
	-$(RM) -r \
		debian/python-opcodes-doc/usr/share/doc/python3-opcodes/html/_static/bootstrap*
