#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Skip the upstream unittest suite: the build chroot has no usable IPv6
# loopback, so test_connect_and_serve_ipv6 always fails with
# ConnectionError (environment limitation, not a code defect).
export DEB_BUILD_OPTIONS += nocheck

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

execute_after_dh_auto_build-indep:
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/' \
	sphinx-build -N -E -T -b html . $(CURDIR)/.pybuild/docs/html/
	rm -rf $(CURDIR)/.pybuild/docs/html/.doctrees
endif
