#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export PYBUILD_NAME=argcomplete
export PYBUILD_AFTER_INSTALL_python3=rm -rf {destdir}/usr/bin

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

generate_manpages:
	VERSION=$$(./setup.py -V) ; \
	for file in activate-global-python-argcomplete python-argcomplete-check-easy-install-script register-python-argcomplete ; do \
		cp -f scripts/$$file debian/$$file ; \
		chmod a+x debian/$$file ; \
		PYTHONPATH=. help2man --version-string="$$VERSION" \
			--no-info --include=debian/help2man.include \
			--name "$$file - argcomplete utility script" \
			-o debian/$$file.1 \
			debian/$$file ; \
		rm -f debian/$$file; \
	done ; \
	rm -f argcomplete/*.py[co]
