#!/usr/bin/make -f
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Disable wxWidgets assertions
export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG -fcommon

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DMEGAGLEST_BIN_INSTALL_PATH=games \
		-DMEGAGLEST_DATA_INSTALL_PATH=share/games/megaglest/ \
		-DWANT_DEV_OUTPATH=ON

override_dh_installchangelogs:
	dh_installchangelogs docs/CHANGELOG.txt

execute_after_dh_install:
	# Remove empty directory
	$(RM) -r debian/megaglest/usr/share/games/megaglest/data
	echo \
		"CountryTexturePath=/usr/share/flags/countries/16x11/" >> \
		debian/megaglest/usr/share/games/megaglest/glest.ini
