#!/usr/bin/make -f

CXXFLAGS += -Wall -Wextra

%:
	dh --parallel --with autoreconf $@

override_dh_auto_configure:
	[ -f src/config.h.clean ] || cp src/config.h src/config.h.clean
	[ -f po/wormux.pot.clean ] || cp po/wormux.pot po/wormux.pot.clean
	
	dh_auto_configure -- --with-datadir-name=\$${prefix}/share/games/wormux \
	  --bindir=\$${prefix}/games --enable-servers --enable-fribidi

override_dh_auto_install:
	dh_auto_install
	
	# these font files will be replaced with symlinks
	rm debian/tmp/usr/share/games/wormux/font/DejaVuSans.ttf
	rm debian/tmp/usr/share/games/wormux/font/VL-Gothic-Regular.ttf
	
	# symlink 32x32 icon instead
	rm debian/tmp/usr/share/pixmaps/wormux_128x128.png

override_dh_auto_clean:
	dh_auto_clean
	
	[ -f src/config.h.clean ] && mv src/config.h.clean src/config.h || :
	[ -f po/wormux.pot ] || mv po/wormux.pot.clean po/wormux.pot

override_dh_install:
	dh_install --list-missing

override_dh_strip:
	dh_strip --dbg-package=wormux-dbg
