#!/usr/bin/make -f

WAF = python3 ./waf

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
	NUMJOBS = 1
endif

%:
	dh $@

override_dh_auto_configure:
	$(WAF) configure \
		--prefix=/usr \
		--strict

override_dh_auto_build:
	$(WAF) build -v --jobs=$(NUMJOBS)

override_dh_auto_clean:
	$(WAF) clean || true
	find -name "*.pyc" -delete
	rm -rf build .waf* get-orig-source
	dh_auto_clean

override_dh_auto_install:
	$(WAF) install --destdir=$(CURDIR)/debian/tmp
