#!/usr/bin/make -f

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

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

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	for i in $(PYTHON3S) ; do \
	    PYTHONPATH=$(CURDIR) \
	        NOSE_WITH_OPENSTACK=1 \
	        NOSE_OPENSTACK_COLOR=1 \
	        NOSE_OPENSTACK_RED=0.05 \
	        NOSE_OPENSTACK_YELLOW=0.025 \
	        NOSE_OPENSTACK_SHOW_ELAPSED=1 \
	        python$$i $(CURDIR)/manage.py test neutron_fwaas_dashboard.test.api_tests -v 2 --settings=neutron_fwaas_dashboard.test.settings ; \
    done
endif

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	rm -rf .coverage*

override_dh_auto_install:
	pkgos-dh_auto_install --no-py2

	# Copy the enabled files
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/enabled
	cp -axuf neutron_fwaas_dashboard/enabled/_70* $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/enabled

override_dh_auto_clean:
	python3 setup.py clean

# NOTE(jamespage): Skip build as no py2 deps installed which confuses the
#                  distutils support in dh_python.
override_dh_auto_build:
	:
