#!/usr/bin/make -f

LDFLAGS+=-Wl,--as-needed
WAF = ./waf
PYVERS=$(shell pyversions -s)

%:
	dh $@ --with python2

override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_install:
	for pyver in $(PYVERS); do \
		PYTHON="$$pyver" $(WAF) configure \
				--prefix=/usr \
				--mandir=/usr/share/man \
				--strict \
				--debug \
				--bindings \
				--dyn-manifest && \
		PYTHON="$$pyver" $(WAF) && \
		PYTHON="$$pyver" $(WAF) install -f --destdir=$(CURDIR)/debian/tmp ; \
	done

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