#!/usr/bin/make -f

LDFLAGS+=-Wl,--as-needed
WAF = ./waf

ifeq ($(shell dpkg-query -s doxygen graphviz 1>/dev/null 2>&1 && echo yes),yes)
CONFIGURE_EXTRA_FLAGS += --docs
endif

%:
	dh $@ --with python2

override_dh_auto_configure:
	$(WAF) configure \
			--prefix=/usr \
			--mandir=/usr/share/man \
			--strict \
			--debug \
			--bindings \
			--dyn-manifest \
			$(CONFIGURE_EXTRA_FLAGS)

override_dh_auto_build:
	$(WAF)

override_dh_auto_clean:
	$(WAF) distclean
	rm -rf build .waf*
	dh_auto_clean

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

override_dh_python2:
	dh_python2 --no-guessing-versions
