#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

override_dh_auto_configure:
	dh_auto_configure -- --prefix=/usr --datadir=/usr/share --bindir=/usr/games --localstatedir=/var/games --libdir=/usr/lib --libexecdir=/usr/lib --without-esd

override_dh_autoreconf:
	cp -f $(shell automake --print-libdir)/mkinstalldirs .
	dh_autoreconf

override_dh_autoreconf_clean:
	rm -f mkinstalldirs
	dh_autoreconf_clean

override_dh_install:
	dh_install
	rm -f $(CURDIR)/debian/dopewars-data/usr/share/doc/dopewars/html/LICENCE
	rm -rf $(CURDIR)/debian/dopewars/var

override_dh_fixperms-arch:
	dh_fixperms
	chgrp games $(CURDIR)/debian/dopewars/usr/games/dopewars
	chmod 2755 $(CURDIR)/debian/dopewars/usr/games/dopewars

override_dh_makeshlibs:
	dh_makeshlibs -Xusr/lib/dopewars

%:
	dh $@ --no-parallel
