#! /usr/bin/make -f 

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

# Needed for testsuite
export XDG_RUNTIME_DIR = $(CURDIR)/debian/tmp/tmp-xdgruntimedir

export DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed

ifeq ($(DEB_BUILD_ARCH_OS),linux)
CONFFLAGS = --with-context-manager=linux
else
CONFFLAGS = --with-context-manager=unix
endif

%:
	dh $@ --with gnome,gir

override_dh_auto_configure:
	dh_auto_configure -- --enable-gtk-doc $(CONFFLAGS)

override_dh_makeshlibs:
	dh_makeshlibs -V -- -c4

override_dh_strip:
	dh_strip --dbgsym-migration='libgupnp-1.0-dbg (<< 0.99.0-1~)'

override_dh_installman:
	xsltproc --novalid --nonet --xinclude -o debian/stripped-docs.xml debian/strip-manpages.xsl doc/gupnp-docs.xml
	xsltproc --novalid --nonet /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl debian/stripped-docs.xml
	rm -f debian/stripped-docs.xml
	dh_installman -p libgupnp-1.0-dev gupnp-binding-tool.1
	dh_installman --remaining-packages

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