#!/usr/bin/make -f

# uncomment for verbose output
#export DH_VERBOSE=1

XP=xsltproc --nonet --novalid
DB2MAN=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl

export PYBUILD_TEST_ARGS=-k 'not test_document_cannot_identify_image and not test_document_with_broken_image'
export PYBUILD_NAME=xhtml2pdf

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

execute_before_dh_installman:
	$(XP) $(DB2MAN) debian/xhtml2pdf3.dbk

execute_after_dh_auto_install:
	# /usr/bin/xhtml2pdf and /usr/bin/pisa are the same thing,
	# let's only install the one, that is documented
	rm debian/python3-xhtml2pdf/usr/bin/pisa
	mv debian/python3-xhtml2pdf/usr/bin/xhtml2pdf debian/python3-xhtml2pdf/usr/bin/xhtml2pdf3
