#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_BINDIR=/usr/games \
		-DUSE_SYSTEM_FONT=ON \
		-DINSTALL_ALL_LANGS=ON \
		-DUSE_SYSTEM_RTMIDI=ON \
		-DWITH_MAN=ON \
		-DWITH_FLUIDSYNTH=ON \
		-DWITH_TIMIDITY=ON \
		-DUSE_FLUIDSYNTH=ON \
		-DUSE_TIMIDITY=ON

override_dh_install:
	dh_install
	@echo Remove stray license file installed by upstream
	-rm --verbose debian/pianobooster/usr/share/licenses/pianobooster/license.txt
	-rmdir --verbose debian/pianobooster/usr/share/licenses/pianobooster
	-rmdir --verbose debian/pianobooster/usr/share/licenses
	@echo Remove ReleaseNotes.txt which is actually the upstream changelog
	-rm debian/pianobooster/usr/share/doc/pianobooster/ReleaseNotes.txt

override_dh_installchangelogs:
	dh_installchangelogs ReleaseNotes.txt

# Not much benefit from compressing the little markdown documentation files.
override_dh_compress:
	dh_compress --exclude=.md

refresh-tr:
	dh_testdir
	@echo Update translations
	lupdate -verbose pianobooster.pro
