#!/usr/bin/make -f

DH_ARGS ?=

export PYBUILD_DESTDIR = debian/dh-virtualenv
export PYBUILD_TEST_ARGS = {dir}/test

%:
	dh $@ --buildsystem=pybuild $(DH_ARGS)

execute_before_dh_auto_clean:
	rm -rf doc/_build
	rm -f doc/dh_virtualenv.1

execute_before_dh_auto_build:
	rst2man doc/dh_virtualenv.1.rst >doc/dh_virtualenv.1

execute_after_dh_auto_build:
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES) $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. python3 -m sphinx -b html -N doc doc/_build/html
endif
