#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-debug \
		--$(if $(filter libgupnp-dlna-doc,$(shell dh_listpackages)),en,dis)able-gtk-doc

execute_before_dh_install:
	# rename gupnp-dlna-*-2.0 binaries to not have the -2.0 postfix
	for program in debian/tmp/usr/bin/gupnp-dlna-*-2.0 ; do \
		mv $$program $${program%%-2.0} ; \
	done
	find debian/tmp -name '*.la' -print -delete
