#!/usr/bin/make -f

include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

GNOME_MODULE := libsoup

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

%:
	dh $@ --with gir,gnome

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-gtk-doc

override_dh_strip:
	dh_strip --dbgsym-migration='libsoup2.4-dbg (<< 2.54.0.1-1~)'

override_dh_makeshlibs:
	dh_makeshlibs -V -- -c4

CHECK_HOME = $(CURDIR)/debian/tmp/home

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	mkdir -p $(CHECK_HOME)
	env XDG_RUNTIME_DIR=$(CHECK_HOME) dbus-run-session -- $(MAKE) check VERBOSE=1
endif

