#!/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

# INSTALLED_TEST=1 will skip /umockdev-record/system-all which causes
# eternal hangs on some buildds
# SLOW_TESTBED_FACTOR=5 will allow slower build systems to avoid
# timing-related test failures
override_dh_auto_test:
	if head -n1 debian/changelog | grep -q '~' ; then \
		env INSTALLED_TEST=1 SLOW_TESTBED_FACTOR=5 dh_auto_test; \
	else \
		env SLOW_TESTBED_FACTOR=5 dh_auto_test; \
	fi

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
