#!/usr/bin/make -f
# -*- makefile -*-

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

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	cd build && cmake .

override_dh_auto_build:
	cd build && make

override_dh_auto_clean:
	rm -rf build/CMakeFiles/ build/CMakeCache.txt build/cmake_install.cmake build/Makefile
	rm -f flare
	dh_auto_clean

override_dh_installman:
	xsltproc --nonet \
		--param make.year.ranges 1 \
		--param make.single.year.ranges 1 \
		--param man.charmap.use.subset 0 \
		-o debian/ \
 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl\
		debian/flare.1.xml
		dh_installman

override_dh_fixperms:
	dh_fixperms
	# wrong upstream repo perms set, already reported and fixed in 0.15
	chmod a-x debian/flare-data/usr/share/games/flare/fonts/white.png

