#!/usr/bin/make -f

export PYBUILD_NAME=launchpadlib
export PYBUILD_TEST_ARGS={dir}/src/launchpadlib/tests {dir}/src/launchpadlib/testing
export PYBUILD_AFTER_INSTALL=rm -r {destdir}{install_dir}/launchpadlib/docs/

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

override_dh_auto_test:
	mkdir -p $(CURDIR)/build/home
	HOME=$(CURDIR)/build/home dh_auto_test --buildsystem=pybuild

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build

override_dh_installdocs:
	dh_installdocs -X NEWS.rst

override_dh_installchangelogs:
	dh_installchangelogs NEWS.rst

override_dh_python3:
	dh_python3 --no-guessing-deps

override_dh_install:
	dh_install
	mkdir -p debian/python3-launchpadlib/usr/lib/systemd/user
	cp debian/launchpadlib-cache-clean* \
	    debian/python3-launchpadlib/usr/lib/systemd/user/