#! /usr/bin/make -f

export PYBUILD_NAME=con-duct
export PYBUILD_BEFORE_TEST=chmod +x {dir}/test/data/spawn_children.sh

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

override_dh_installman: build/duct.1
	dh_installman

build/duct.1:
	: # Generate a manpage using help2man
	mkdir -p build
	cp -p src/con_duct/__main__.py build/duct
	help2man --no-info --no-discard-stderr \
		-n "lightweight wrapper that collects execution data for a command" \
		./build/duct >| build/duct.1
	rm -f build/duct
	: # Verify that manpage generated nicely -- no Errors reported
	grep -q 'ImportError:' build/duct.1 && exit 1 || :
