#!/usr/bin/make -f

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

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

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	for i in $(PYTHONS) ; 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 -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-py3

	# Copy the enabled files
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages/openstack_dashboard/enabled
	mkdir -p $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/enabled
	cp -axuf neutron_fwaas_dashboard/enabled/_70*.py $(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages/openstack_dashboard/enabled
	cp -axuf neutron_fwaas_dashboard/enabled/_70*.py $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/enabled

override_dh_auto_clean:
	python setup.py clean

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