#!/usr/bin/make -f

export PYBUILD_NAME=tango
export PYBUILD_INSTALL_ARGS_python2=--install-html=$(CURDIR)/debian/python-tango-doc/usr/share/doc/python-tango-doc/html

# sphinxdoc is available only when building the arch-all packages
WITH_SPHINXDOC = $(shell if [ -x /usr/bin/dh_sphinxdoc ]; then echo "--with sphinxdoc"; fi)

%:
	dh $@ --with python2,python3 $(WITH_SPHINXDOC) --buildsystem=pybuild

override_dh_auto_install:
	dh_auto_install -O--buildsystem=pybuild
	dh_numpy
	dh_numpy3

override_dh_installdocs:
	dh_installdocs
ifneq (,$(filter python-tango-doc, $(shell dh_listpackages)))
	# add the - for backport where dh_sphinxdoc is not available
	-dh_sphinxdoc -ppython-tango-doc
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build
	rm -rf *.egg-info
