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

#export DH_VERBOSE=1

export PYBUILD_NAME=django-cachalot
# We cannot run the test suite yet; upstream issue pending
export PYBUILD_DISABLE=test

%:
	dh $@ --buildsystem=pybuild

override_dh_clean:
	dh_clean
	rm -rf .mypy_cache

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=$(CURDIR)/cachalot \
	     python3 -m sphinx -b html $(SPHINXOPTS) docs $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html
	cp $(CURDIR)/django-cachalot.jpg $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html/_images
	dh_sphinxdoc
endif
