#!/usr/bin/make -f

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

override_dh_auto_configure:
	find .pc -type f -name '*.c' -exec echo '{}' >> po/POTFILES.skip \;
	dh_auto_configure -- --enable-thunarx --enable-exo \
	 	--docdir=\$${prefix}/share/doc/xfdesktop4-data

override_dh_auto_clean:
	rm -f po/POTFILES.skip
	dh_auto_clean

override_dh_install:
	chrpath -d -k $(CURDIR)/debian/tmp/usr/bin/*
	
	dh_install --sourcedir=debian/tmp --fail-missing
	# why oh why is this necessary?
	rm -rf $(CURDIR)/debian/xfdesktop4-data/usr/share/man

override_dh_link:
	rm -rf $(CURDIR)/debian/xfdesktop4/usr/share/doc/xfdesktop4
	ln -s xfdesktop4-data $(CURDIR)/debian/xfdesktop4/usr/share/doc/xfdesktop4
	dh_link

override_dh_strip:
	dh_strip --dbg-package=xfdesktop4-dbg

%:
	dh $@
