#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
	--prefix=/usr --bindir=/usr/games \
	--localstatedir=/var --mandir=/usr/share/man \
	--with-sdl --disable-joystick

override_dh_install:
	dh_install

	# the score file is handled by maintainer scripts, so move it here
	cp $(CURDIR)/debian/xsoldier/var/games/xsoldier/xsoldier.scores \
	$(CURDIR)/debian/xsoldier/usr/share/games/xsoldier/xsoldier.scores
	rm -r $(CURDIR)/debian/xsoldier/var/

override_dh_fixperms:
	dh_fixperms
	chown root:games $(CURDIR)/debian/xsoldier/usr/games/xsoldier
	chmod 2755 $(CURDIR)/debian/xsoldier/usr/games/xsoldier
