#!/usr/bin/make -f

export PYBUILD_NAME = bugzilla

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

override_dh_auto_test:
# Setting $HOME here is needed because some tests use
# 'os.path.expanduser'.
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	set -ex; for py in $(shell pyversions -r) $(shell py3versions -r); do \
		HOME=/tmp/ $$py -m pytest; \
	done
endif

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
