#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall
export QT_SELECT = 6

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_DATAROOTDIR="share/vym" \
		-DCMAKE_INSTALL_MANDIR="share/man/man1" \
		-DCMAKE_INSTALL_DOCDIR="share/doc/vym"

override_dh_auto_install:
	dh_auto_install --destdir=debian/vym/
	# Remove empty directory
	rmdir debian/vym/usr/share/doc/vym/devel
	# Ensure helper scripts are executable
	chmod +x debian/vym/usr/share/vym/scripts/vivym \
		 debian/vym/usr/share/vym/scripts/vym-addmail.rb

# prevent compression of pdf documentation
override_dh_compress:
	dh_compress -X.pdf
