#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DEBIAN  := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')

%:
	dh $@ --with autoreconf

# enable-static: we require the tests to link to the static libosmo-sigtran
# library to access symbols not starting with osmo_*
override_dh_auto_configure:
	dh_auto_configure -- --enable-static

# Print test results in case of a failure
override_dh_auto_test:
	dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)

override_dh_clean:
	dh_clean
	rm -f .version tests/package.m4 tests/testsuite
