#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --without autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
		--bindir=/usr/games \
		--datadir=/usr/share/games \
		--mandir=/usr/share/man

override_dh_compress:
	dh_compress -Xmanual.pdf

# Grab the version before +dfsg
DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p')
get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=.
	rm -rf  amoebax-$(DEB_UPSTREAM_VERSION)
	tar -xjf amoebax_$(DEB_UPSTREAM_VERSION).orig.tar.bz2
	rm amoebax_$(DEB_UPSTREAM_VERSION).orig.tar.bz2
	rm -r amoebax-$(DEB_UPSTREAM_VERSION)/data/dlls
	mv amoebax-$(DEB_UPSTREAM_VERSION) amoebax-$(DEB_UPSTREAM_VERSION).orig
	GZIP=--best tar -cj --owner root --group root --mode a+rX \
                        -f amoebax_$(DEB_UPSTREAM_VERSION)+dfsg.orig.tar.bz2 \
                        amoebax-$(DEB_UPSTREAM_VERSION).orig
	rm -r amoebax-$(DEB_UPSTREAM_VERSION).orig