#!/usr/bin/make -f

export PYBUILD_NAME=cryptolyzer
export CRYPTOLYZER_TEST_SKIP_LIVE_SERVER=1
export CRYPTOLYZER_TEST_SKIP_LIVE_DNS=1
export http_proxy=
export https_proxy=
export no_proxy=localhost,127.0.0.1,::1
export NO_PROXY=localhost,127.0.0.1,::1

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

execute_before_dh_sphinxdoc:
	PYTHONPATH=. python3 -m sphinx -b html -N docs/ \
	    $(CURDIR)/debian/python-cryptolyzer-doc/usr/share/doc/python-cryptolyzer-doc/html

execute_before_dh_auto_test:
	for d in $(CURDIR)/.pybuild/cpython3_*/build; do \
	    [ -d "$$d" ] || continue; \
	    ln -fs $(CURDIR)/tools $$d/; \
	done

execute_after_dh_auto_test:
	for d in $(CURDIR)/.pybuild/cpython3_*/build; do \
	    [ -d "$$d" ] || continue; \
	    rm -f $$d/tools; \
	done
