#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

ifeq ($(DEB_HOST_ARCH), alpha)
  DEB_OPT_FLAG += -O2 -mieee
endif

DEB_CONFIGURE_EXTRA_FLAGS := --datadir=\$${prefix}/share/games --bindir=\$${prefix}/games --docdir=\$${prefix}/share/doc/enigma --enable-optimize

binary-post-install/enigma-data::
	# remove duplicate .desktop file
	-rm debian/enigma-data/usr/share/applications/enigma.desktop
	-rmdir --ignore-fail-on-non-empty --parents debian/enigma-data/usr/share/applications

	-rm debian/enigma-data/usr/share/games/enigma/fonts/DejaVuSansCondensed.ttf
	-rm debian/enigma-data/usr/share/games/enigma/fonts/vera_sans.ttf
	# yes, using DejaVuSans instead of Vera Sans, one dependency less
	# and the fonts are pretty much the same anyway
	dh_link -p enigma-data \
		usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf \
		usr/share/games/enigma/fonts/DejaVuSansCondensed.ttf \
		usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
		usr/share/games/enigma/fonts/vera_sans.ttf
	# update icon caches
	dh_icons

clean::
	-rm -f po/*.gmo po/stamp-po
