#!/usr/bin/make -f

export DEB_CFLAGS_MAINT_APPEND = -Wall -W -pedantic -std=c99 -g -D_GNU_SOURCE

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
export DEB_CFLAGS_MAINT_APPEND = -O0
else
export DEB_CFLAGS_MAINT_APPEND = -O2
endif

%:
	dh $@ --without autoreconf

override_dh_auto_configure:
	./configure --prefix=/usr --bindir=/usr/games --localstatedir=/var \
		--sysconfdir=/etc

execute_after_dh_auto_install:
	rm debian/typespeed/var/games/typespeed.score

execute_after_dh_fixperms:
	chown root:games debian/typespeed/usr/games/typespeed
	chmod g+s        debian/typespeed/usr/games/typespeed
