#!/usr/bin/make -f

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

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

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=hg@$(CURDIR) /usr/bin/bzr selftest --parallel=fork \
	    -v -s bp.hg
endif
