#!/usr/bin/make -f

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

export PYBUILD_NAME=zunclient

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

override_dh_auto_install:
	dh_auto_install --buildsystem=pybuild
	mv $(CURDIR)/debian/python-zunclient/usr/bin/zun $(CURDIR)/debian/python-zunclient/usr/bin/python2-zun
	mv $(CURDIR)/debian/python3-zunclient/usr/bin/zun $(CURDIR)/debian/python3-zunclient/usr/bin/python3-zun

override_dh_auto_test:
	set -e; for pyvers in $(PYTHONS) $(PYTHON3S); do \
		PYMAJOR=`echo $$pyvers | cut -d'.' -f1` ; \
		PYTHON=python$$pyvers PYTHONPATH=$(CURDIR) python$$PYMAJOR-ostestr \
			--blacklist-file=$(CURDIR)/debian/test-blacklist.txt; \
	done
