#!/usr/bin/make -f

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

export PYBUILD_NAME=reentry
export PY3VERSION=$(shell py3versions -d)

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

# Tests will be performed in autopkgtest
override_dh_auto_test:

override_dh_auto_clean:
	dh_auto_clean
	rm -rf reentry.egg-info

override_dh_installman:
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
	PYTHONPATH=debian/python3-reentry/usr/lib/${PY3VERSION}/dist-packages XDG_CONFIG_HOME=debian/tmp-cache \
		help2man debian/python3-reentry/usr/bin/reentry \
		--version-string=$(DEB_VERSION_UPSTREAM) --no-info \
		--name='manage your reentry python entry point cache' > debian/reentry.1
	rm -rf debian/python3-reentry/usr/lib/${PY3VERSION}/dist-packages/reentry/__pycache__ debian/tmp-cache
	dh_installman
	rm -f debian/reentry.1
endif
