#!/usr/bin/make -f

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

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

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

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

override_dh_installchangelogs:
	dh_installchangelogs NEWS
