#!/usr/bin/make -f

UPSTREAM_GIT = https://github.com/openstack/bandit.git
include /usr/share/openstack-pkg-tools/pkgos.make

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

override_dh_auto_install:
	pkgos-dh_auto_install

	# Generate the config file
	mkdir -p $(CURDIR)/debian/bandit/etc/bandit
	PYTHONPATH=$(CURDIR)/debian/python-bandit/usr/lib/python2.7/dist-packages PATH=$$PATH:$(CURDIR)/debian/bin bandit-config-generator -o $(CURDIR)/debian/bandit/etc/bandit/bandit.yaml

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	PATH=$$PATH:$(CURDIR)/debian/bin pkgos-dh_auto_test 'tests\.(?!(.*unit\.cli\.test_baseline\.BanditBaselineToolTests\.test_bandit_baseline.*|.*functional\.test_runtime.*|.*functional\.test_baseline.*))'
endif
