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

#export DH_VERBOSE = 1
include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export PYBUILD_NAME=piqtree
export PYBUILD_AFTER_INSTALL=rm -fr {destdir}/usr/lib/python3*/dist-packages/$(PYBUILD_NAME)-*/top_level.txt

include /usr/share/dpkg/pkg-info.mk

%:
	dh $@ --buildsystem=pybuild

execute_before_dh_clean:
	rm -rf html

execute_after_dh_auto_build:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=`dirname $$(find .pybuild/ -type d -name "*piqtree*dist-info" | head -n1)` \
	    python3 -m mkdocs build -v -d html
	rm html/sitemap.xml.gz
endif
