#!/usr/bin/make -f

export PYBUILD_NAME = bugzilla
export PYBUILD_AFTER_INSTALL_python2 = $(RM) -rv {destdir}/usr/bin {destdir}/usr/share/man

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

override_dh_auto_test:
# Setting $HOME here is needed because some tests use
# 'os.path.expanduser'.
	HOME=/tmp/ python setup.py test
	HOME=/tmp/ python3 setup.py test

override_dh_install:
	dh_install
# We have a dedicated package for the CLI part of the package, so here
# we delete the files under /usr/bin.
	rm -rf debian/python3-bugzilla/usr/bin
# We also ship the CLI manpage within the appropriate package.
	rm -rf debian/python3-bugzilla/usr/share/man
