#!/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
d_app := $(CURDIR)/debian/gtamsanalyzer.app

%:
	dh $@ --sourcedirectory=Source

override_dh_auto_build:
	dh_auto_build -- $(optim) $(verbose) \
	  $(shell dpkg-buildflags --export=cmdline)

execute_before_dh_link:
	gsdh_gnustep --app
	convert Source/largeApp.tif -resize 64x64 \
	  $(d_app)/usr/share/GNUstep/GTAMSAnalyzer.app/app-icon.png
# Convert .strings file to UTF-8 to placate lintian.
	iconv -f UTF-16BE -t UTF-8 Source/FindPanel.strings > \
	  $(d_app)/usr/share/GNUstep/GTAMSAnalyzer.app/FindPanel.strings

override_dh_compress:
	dh_compress --exclude=.pdf

override_dh_fixperms:
	dh_fixperms
	find $(d_app)/usr/share/GNUstep -name \*.tif* -exec chmod -x '{}' \;
	chmod -x $(d_app)/usr/share/GNUstep/*.app/*.strings
