#! /usr/bin/make -f

export PYBUILD_NAME=behave
%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build-indep:
	dh_auto_build -i
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	cd docs && \
	PYTHONPATH=$(CURDIR) http_proxy='http://127.0.0.1:9/' https_proxy='https://127.0.0.1:9/' \
	python3 -m sphinx -N -E -T -b html . $(CURDIR)/.pybuild/docs/html/
	rm -rf $(CURDIR)/.pybuild/docs/html/.doctrees
endif

override_dh_auto_test:
	# move "tests" directory aside so pybuild reliably invokes "test" instead of "tests" (#1054974)
	mv tests tests.disabled
	dh_auto_test -O--buildsystem=pybuild
	mv tests.disabled tests
