#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs -Wl,--as-needed

ifneq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	DOC_FLAGS += --disable-gtk-doc
else
	DOC_FLAGS += --enable-gtk-doc
endif

%:
	dh $@ --with gnome,gir

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-static \
		--enable-glade-catalog \
		$(DOC_FLAGS)

override_dh_install:
	find debian -name '*.la' -print -delete
	dh_install --fail-missing

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

override_dh_auto_test:
	xvfb-run dh_auto_test
