#!/usr/bin/make -f

#export DH_VERBOSE = 1

BUILD_DATE  = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")

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

export PYBUILD_NAME=python-vmware-nsxlib

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

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	rm -rf .testrepository build __pycache__

override_dh_auto_install:
	python setup.py install --install-layout=deb \
                --root $(CURDIR)/debian/python-vmware-nsxlib
	set -e; python3 setup.py install --install-layout=deb \
                --root $(CURDIR)/debian/python3-vmware-nsxlib

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	pkgos-dh_auto_test 'vmware_nsxlib\.tests\.*'
endif

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	rm -rf .testrepository build
