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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

WITH_PYTHON2 = $(shell test -f /usr/bin/dh_python2 && echo "--with python2")

%:
	dh ${WITH_PYTHON2} $@

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]
