#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

export PYBUILD_TEST_ARGS=--pyargs codespell_lib -k "not test_permission_error"
export PYBUILD_AFTER_TEST=find {dir} -name junit-results.xml -delete

%:
	dh $@ --buildsystem=pybuild

execute_before_dh_installman:
	sed "s,PYTHONPATH=.,PYTHONPATH=`ls -d ./debian/codespell/usr/lib/python3*/dist-packages/`," < Makefile > tmp.mk
	PATH=$(PATH):$(CURDIR)/debian/codespell/usr/bin \
		$(MAKE) -f tmp.mk codespell.1
	rm -f tmp.mk
