#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-alternate-fire-key \
		--bindir=\$${prefix}/games \
		--datadir=\$${prefix}/share/games

override_dh_install:
	dh_install
	mv $(CURDIR)/debian/dodgindiamond2/usr/games/dd2 \
		$(CURDIR)/debian/dodgindiamond2/usr/games/dodgindiamond2
	find $(CURDIR)/debian/dodgindiamond2/ -name "COPYING" -delete
	rm -f $(CURDIR)/debian/dodgindiamond2/usr/share/games/dodgindiamond2/dd2-hiscore
	rm -rf $(CURDIR)/debian/dodgindiamond2/usr/share/games/doc

override_dh_fixperms:
	dh_fixperms
	chmod 2755 $(CURDIR)/debian/dodgindiamond2/usr/games/dodgindiamond2
	chgrp games $(CURDIR)/debian/dodgindiamond2/usr/games/dodgindiamond2
	chgrp games $(CURDIR)/debian/dodgindiamond2/var/games/dodgindiamond2
