#!/usr/bin/make -f

export PYBUILD_NAME=erfa
export PYBUILD_TEST_ARGS=-k "not test_version_with_embedded_liberfa" --pyargs ${PYBUILD_NAME}
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export PYERFA_USE_SYSTEM_LIBERFA=1

include /usr/share/dpkg/pkg-info.mk
export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM:+ds=)

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build: export http_proxy=127.0.0.1:9
execute_after_dh_auto_build: export https_proxy=127.0.0.1:9
execute_after_dh_auto_build:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	cd docs && \
	PYTHONPATH=$(shell pybuild --build -i python3 -s custom --build-args 'echo {build_dir}') \
	python3 -m sphinx -N -E -T -b html $(CURDIR)/docs $(CURDIR)/.pybuild/docs/html
endif
