#!/usr/bin/make -f

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

override_dh_auto_clean:
	-rm -rf build test*.tmp 
	find . -name "*.pyc" -print0 | xargs -0 rm -f
	dh_auto_clean

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
CONCURRENCY = BZR_CONCURRENCY=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	$(CONCURRENCY) BZR_PLUGINS_AT=webdav@$(CURDIR) /usr/bin/bzr selftest -v \
	    --parallel=fork -s bp.webdav
endif
