#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PKG3=python3-hpilo
PKGD=python-hpilo-doc

# https://github.com/seveas/python-hpilo/issues/272
export PYBUILD_DISABLE=test

export PYBUILD_NAME=hpilo

%:
	dh $@ --with sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	$(MAKE) -C docs html

override_dh_install:
	python3 setup.py install --root=$(CURDIR)/debian/$(PKG3)/ --install-layout=deb

	# move generated doc in its own package
	mkdir -p $(CURDIR)/debian/$(PKGD)/usr/share/doc/$(PKGD)
	cp -arp docs/_build/html $(CURDIR)/debian/$(PKGD)/usr/share/doc/$(PKGD)

override_dh_auto_clean:
	rm docs/_build -rf
	rm examples/elasticsearch/.gitignore
	dh_auto_clean
