#!/usr/bin/make -f

PYTHONS:=$(shell pyversions -vr)

include /usr/share/openstack-pkg-tools/pkgos.make

%:
	dh $@ --with python2,systemd

override_dh_install:
	dh_install --fail-missing

get-orig-source:
	uscan --verbose --force-download --rename --destdir=../build-area

override_dh_auto_clean:
	dh_auto_clean
	rm -f debian/*.init debian/*.service debian/*.upstart
	rm -rf .eggs

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	python run_tests.py
	set -e ; \
		TEMP_REZ=`mktemp -t` ; \
		python setup.py testr --slowest --testr-args='--subunit'| tee $$TEMP_REZ | subunit2pyunit; \
		cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats || true; \
		rm -f $$TEMP_REZ
endif
