#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/GNUstep/debian/config.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-undefined -Wl,--as-needed
d_app := $(CURDIR)/debian/tmp
d_com := $(CURDIR)/debian/lynkeos.app-common

%:
	dh $@ --sourcedirectory=GNUstep

override_dh_auto_build:
	dh_auto_build -- $(optim) messages=yes \
	  $(shell dpkg-buildflags --export=cmdline)
	icns2png --extract --size 48 Resources/Lynkeos.icns

override_dh_link-indep:
	dh_installdirs usr/share/GNUstep
	$(RM) $(d_app)$(GNUSTEP_SYSTEM_APPS)/Lynkeos.app/Resources/*.desktop
	mv $(d_app)$(GNUSTEP_SYSTEM_APPS)/Lynkeos.app/Resources \
	  $(d_com)/usr/share/GNUstep/Lynkeos.app
	dh_link /usr/share/GNUstep/Lynkeos.app \
	  $(GNUSTEP_SYSTEM_APPS)/Lynkeos.app/Resources

override_dh_fixperms-indep:
	dh_fixperms
	chmod -x $(d_com)/usr/share/GNUstep/*.app/Italian.lproj/*
