#!/usr/bin/make -f

## Enable compiler hardening flags.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
## Only link with needed libraries
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --parallel

override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DCREDITSDIR=/usr/share/doc/rawtherapee -DLICENCEDIR=/usr/share/doc/rawtherapee

override_dh_install-arch:
	dh_install
	convert -geometry 32x32 rtdata/icons/hi32-app-rawtherapee.png debian/rawtherapee/usr/share/pixmaps/rawtherapee.xpm
	rm debian/rawtherapee/usr/share/doc/rawtherapee/LICENSE.txt

override_dh_install-indep:
	dh_install
	cp rtengine/camconst.json debian/rawtherapee-data/usr/share/rawtherapee/camconst.json
	chmod 644 debian/rawtherapee-data/usr/share/rawtherapee/camconst.json
	rm debian/rawtherapee-data/usr/share/rawtherapee/languages/LICENSE

