#!/usr/bin/make -f

export PYBUILD_NAME=networking-ansible
export PBR_VERSION="$(dpkg-query --showformat='${Version}' --show python3-pbr)"

%:
	dh ${@} --buildsystem=pybuild --with python3,sphinxdoc

override_dh_auto_test:
	# disabled, testsuite doesn't work yet.

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=$(CURDIR)/debian/python-$(PYBUILD_NAME)/usr/lib/python3/dist-packages PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html
	dh_sphinxdoc
	rm -rf $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html/_static/js/jquery-3.2.1*
endif

execute_after_dh_install:
	mv debian/python3-networking-ansible/usr/etc debian
