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

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

export PYBUILD_NAME=tablib
export PYBUILD_AFTER_INSTALL=rm -rf {destdir}/usr/lib/python3*/dist-packages/htmlcov \
                                    {destdir}/usr/lib/python3*/dist-packages/.coverage \
                                    {destdir}/usr/lib/python3*/dist-packages/coverage.xml
export PYBUILD_SYSTEM=pyproject

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

override_dh_clean:
	# Remove runtime generated file _version.py.
	rm -f src/tablib/_version.py
	dh_clean

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=src python3 -m sphinx -b html -N docs/ $(CURDIR)/debian/python-tablib-doc/usr/share/doc/python-tablib-doc/html
	dh_sphinxdoc
endif

override_dh_installchangelogs:
	dh_installchangelogs HISTORY.md
