#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_CXXFLAGS_MAINT_APPEND = -D__DEBIAN__ -O2 -g -Wno-write-strings -DUSE_EXTERNAL_CLUSTALW
include /usr/share/dpkg/default.mk

%:
	dh $@

execute_before_dh_auto_build:
	mv tips_de.txt tips_de.iso8859
	iconv -f ISO-8859-15 -t UTF-8 < tips_de.iso8859 > tips_de.txt

override_dh_install:
	dh_install
	cd debian/$(DEB_SOURCE)/usr/share/$(DEB_SOURCE); for i in help/*.html help/*.css *.db help/*.htm */*.png */*.x[bp]m */*.bmp *.txt */*.txt *.csv; do chmod -x "$$i"; done
	find debian -name "license.txt" | xargs -r rm

override_dh_installdocs:
	dh_installdocs
	cp -a docs/GENtle*en*.pdf    debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/GENtle_manual.pdf
	cp -a docs/GENtle*Manual.pdf debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/GENtle_manual_de.pdf
	find debian -name todo.txt -delete

override_dh_auto_clean:
	dh_auto_clean
	find . -name "*.o"  | xargs -r rm
	rm -f GENtle

override_dh_compress:
	dh_compress --exclude=.pdf
