#!/usr/bin/make -f

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

export PYBUILD_NAME=docxcompose

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

override_dh_auto_test:
	dh_auto_test -- --test-pytest

override_dh_installman: debian/docxcompose.1
	dh_installman

override_dh_auto_clean:
	dh_auto_clean
	rm -rf docxcompose.egg-info

debian/docxcompose.1:
	PYTHONPATH=$$(find debian -name dist-packages | xargs echo | tr ' ' :) help2man \
		debian/python3-docxcompose/usr/bin/docxcompose \
		--name 'compose multiple docx files into one file' \
		--version-string $(DEB_VERSION_UPSTREAM) --no-info > $@
