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

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

%:
	dh $@

override_dh_auto_configure:
	cd build && cmake .

override_dh_auto_build:
	cd build && make

override_dh_auto_clean:
	-rm -rf build/CMakeFiles/ 
	-rm flare
	-rm build/CMakeCache.txt
	-rm build/cmake_install.cmake
	-rm build/Makefile
	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/usr/share/games/flare/fonts/white.png

