#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

# Automatically generate man pages with help2man
export PYBUILD_AFTER_INSTALL_python3 := \
	echo 'Automatically generating man pages with help2man' && \
	mkdir -p {destdir}/usr/share/man/man1 && \
	ls {destdir}/usr/bin | env PYTHONPATH={destdir}{install_dir} \
	xargs --verbose -I @ \
	help2man \
		--section 1 \
		--source $(DEB_SOURCE) \
		--version-string $(DEB_VERSION_UPSTREAM) \
		--no-info \
		--no-discard-stderr \
		--output {destdir}/usr/share/man/man1/@.1 \
		{destdir}/usr/bin/@

# disable running of unit tests during build
override_dh_auto_test:
	true

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