#!/usr/bin/make -f

libtotem-plparserN := $(shell sed -rn 's/^Package:[[:space:]]*(libtotem-plparser[0-9]+)[[:space:]]*$$/\1/p' debian/control)

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

%:
	dh $@ --with gnome,gir

override_dh_auto_configure:
	dh_auto_configure -- \
		--libexecdir=/usr/lib/$(DEB_HOST_MULTIARCH)/$(libtotem-plparserN) \
		-Denable-gtk-doc=true \
		-Denable-libarchive=yes \
		-Denable-libgcrypt=yes \
		-Denable-quvi=yes

override_dh_makeshlibs:
	dh_makeshlibs -p $(libtotem-plparserN) -V -- -c4
	dh_makeshlibs --remaining-packages

override_dh_strip:
	dh_strip --dbgsym-migration="libtotem-plparser-dbg (<< 3.10.6-5~)"

override_dh_auto_test:
	dh_auto_test -- --wrapper dbus-run-session -v --print-errorlogs
