#!/usr/bin/make -f

TMPDIR=maelstrom
DATADIR=debian/${TMPDIR}/usr/share/games/Maelstrom
ICONDIR=debian/${TMPDIR}/usr/share/icons/hicolor/48x48/apps

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

export DEB_CFLAGS_MAINT_APPEND = -Wall
export DEB_CXXFLAGS_MAINT_APPEND = -Wall

%:
	dh $@

override_dh_autoreconf:
	dh_autoreconf -- ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- \
	  --bindir='$${exec_prefix}/games' \
	  --datadir='$${prefix}/share/games'

execute_after_dh_auto_install:
# duplicate executable installed
	rm -f ${DATADIR}/Maelstrom
# installed/copied separately
	rm -rf ${DATADIR}/Docs/
	rm -f ${DATADIR}/COPYING*
	rm -f ${DATADIR}/README*
# PNG icon for the desktop file
	convert icon.xpm ${ICONDIR}/maelstrom.png

override_dh_installchangelogs:
	dh_installchangelogs Changelog
