#!/usr/bin/make -f

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

export DEB_CFLAGS_MAINT_APPEND := -fpermissive
export DEB_CXXFLAGS_MAINT_APPEND := $(DEB_CFLAGS_MAINT_APPEND)
export DEB_BUILD_MAINT_OPTIONS := hardening=-format

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- --bindir=\$${prefix}/games \
	  --datadir=\$${prefix}/share/games --with-highscores=~

# Still need to adjust po/Makefile.in.in to set mkinstalldirs to "install -d"

override_dh_auto_install:
	dh_auto_install - \
	  iconsdir=/usr/share/icons/hicolor \
	  desktopdir=/usr/share/applications
	$(RM) debian/tmp/usr/share/games/applications/trackballs.desktop
	find debian/tmp -type d -empty -delete

override_dh_install:
	dh_install --fail-missing
