#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Enable verbose build details.
export V=1

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_clean:
	dh_auto_clean
	rm -f regression.out

#override_dh_auto_configure:
#	./configure --prefix=/usr \
#	  --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	make check 2>&1 | tee regression.out && \
	  grep -q "^ tests failed: 0" regression.out || true
endif
