#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_CMAKE_EXTRA_FLAGS = -DWANT_SHARED=OFF \
 -DWANT_PORTAUDIO=ON \
 -DWANT_PORTMIDI=ON \
 -DWANT_RUBBERBAND=ON

export QTDIR=/usr/lib/qt5

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure --buildsystem=cmake -- $(DEB_CMAKE_EXTRA_FLAGS)

execute_after_dh_auto_build:
	mv ./data/img/h2-icon.bmp ./data/img/h2-icon.png
	make -C documentation \
	     manual_en.html tutorial_en.html tutorial_fr.html tutorial_it.html

execute_before_dh_clean:
	mv ./data/img/h2-icon.png ./data/img/h2-icon.bmp || true

execute_after_dh_auto_install:
	rm -rf debian/tmp/usr/share/hydrogen/data/new_tutorial
	rm -f  debian/tmp/usr/share/hydrogen/data/doc/res/LICENSE

# No dbgsym packages:
override_dh_strip:
	@echo "NO--THANKS ANYWAY--but not building dbgsym packages for MX Linux"
	dh_strip --no-automatic-dbgsym
