#!/usr/bin/make -f

export PYBUILD_NAME=pygit2
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=pybuild

html_doc_dir = $(CURDIR)/debian/python-pygit2-doc/usr/share/doc/python-pygit2-doc
execute_after_dh_auto_install:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C docs html \
		BUILDDIR="$(html_doc_dir)" \
		PYTHONPATH="$(shell pybuild --print {build_dir} --interpreter=python3)"
	rm -rf $(html_doc_dir)/doctrees
endif