#! /usr/bin/make -f

#export DH_VERBOSE = 1
export PYBUILD_NAME = reprotest

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

# It's hard to make sure disorderfs works on buildds, so drop it.
# The build user needs fuse access and this is not easily arranged.
export REPROTEST_TEST_DONTVARY = fileordering

override_dh_auto_configure:
	test $$(python3 setup.py --version) = $$(dpkg-parsechangelog -SVersion)
	dh_auto_configure

override_dh_auto_build:
	dh_auto_build
	cd doc && $(MAKE)

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	VIRTUALENV_DOWNLOAD=no \
	http_proxy=http://127.0.9.1:9 \
	https_proxy=https://127.0.9.1:9 \
	TOX_TESTENV_PASSENV=PYTHONIOENCODING PYTHONIOENCODING=utf-8 \
	tox -r --sitepackages -- -s
endif

override_dh_auto_clean:
	dh_auto_clean
	cd doc && $(MAKE) clean
