#!/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
DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')

%:
	dh $@ --with autoreconf

override_dh_install:
	dh_install --list-missing
	cd debian/$(DEBPKGNAME)/usr/share/$(DEBPKGNAME); 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/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/GENtle_manual.pdf
	cp -a docs/GENtle*Manual.pdf debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/GENtle_manual_de.pdf

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

override_dh_compress:
	dh_compress --exclude=.pdf
