#! /usr/bin/make -f

#export DH_VERBOSE=1
export PYBUILD_NAME=importlab
%:
	dh $@ --with python3 --buildsystem=pybuild

execute_before_dh_installman:
	PYTHONPATH=. help2man -n'A library to calculate python dependency graphs.' \
		debian/python3-importlab/usr/bin/importlab > importlab.1

# Unfortunately, dh_python3's --shebang option doesn't work in this
# case.  We have to rewrite the shebang ourselves.
#
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103150 for
# more information.
execute_after_dh_install:
	find $(CURDIR)/debian/python3-importlab/usr/bin \
		-executable -type f \
		-exec sed -i 's,^#!python$$,#!/usr/bin/python3,' '{}' ';'
