#!/usr/bin/make -f

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

export OSLO_PACKAGE_VERSION=$(VERSION)

export SWIFT_HOST=http://127.0.0.1:9

%:
	dh $@  --with python2,sphinxdoc

override_dh_clean:
	dh_clean

	rm -rf cover .coverage

override_dh_auto_test:
	NOSE_WITH_OPENSTACK=1 \
		NOSE_OPENSTACK_COLOR=1 \
		NOSE_OPENSTACK_RED=0.05 \
		NOSE_OPENSTACK_YELLOW=0.025 \
		NOSE_OPENSTACK_SHOW_ELAPSED=1 \
		NOSE_OPENSTACK_STDOUT=1 \
		NOSE_WITH_COVERAGE=1 \
		NOSE_COVER_BRANCHES=1 \
		nosetests -v --exclude-dir=swift3/test/functional
#	set -e ; for pyversion in $(shell pyversions -r); do $$pyversion setup.py test; done

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. sphinx-build doc/source $(CURDIR)/debian/swift-plugin-s3/usr/share/doc/swift-plugin-s3/html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif
