#!/usr/bin/make -f

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --datadir=/usr/share/games --bindir=/usr/games --without-ggi --with-sdl --with-mikmod --with-sdl-mixer

override_dh_autoreconf:
# The code uses an old gettext Makefile.in.in which needs mkinstalldirs
	cp tools/mkinstalldirs .
	dh_autoreconf
	mv mkinstalldirs tools

override_dh_autoreconf_clean:
	cp tools/mkinstalldirs .
	dh_autoreconf_clean
	mv mkinstalldirs tools

override_dh_fixperms:
	dh_fixperms -Xheroes

override_dh_install-arch:
	dh_install
	chown root:games debian/heroes/usr/games/heroes
	chmod g+s debian/heroes/usr/games/heroes
	rm -rf debian/heroes/usr/share/games/heroes/etc

override_dh_auto_test:
	srcdir=$(CURDIR)/tests VERBOSE=1 dh_auto_test
