#!/usr/bin/make -f

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

%:
	dh $@ --with gir

override_dh_auto_configure:
	# building from trunk checkout?
	[ -x ./autogen.sh ] && ./autogen.sh || true
	dh_auto_configure -- \
		--disable-silent-rules \
		--enable-gtk-doc \
		--enable-introspection

# tests fail in PPA builders, so don't make them fatal for daily builds
override_dh_auto_test:
	if ! dh_auto_test; then \
	    head -n1 debian/changelog | grep -q '~' || exit 1; \
	fi
	# this will skip /umockdev-record/system-all which causes eternal hangs
	# on some buildds
	env INSTALLED_TEST=1 dh_auto_test

override_dh_install:
	dh_install -X.a -X.la --fail-missing

# strict symbol checking for normal builds, but not for daily autobuilds
override_dh_makeshlibs:
	if head -n1 debian/changelog | grep -q '~'; then \
		dh_makeshlibs; \
	else \
		dh_makeshlibs -- -c4; \
	fi
