#!/usr/bin/make -f

SHELL+= -e
#export DH_VERBOSE=1

build:
	$(checkdir)
	touch build

clean:
	$(checkdir)
	-rm -f build
	-rm -rf debian/tmp debian/files debian/substvars debian/*.debhelper

binary-indep: checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp/usr/lib/games/purity/ \
		debian/tmp/usr/doc/purity-off
	cp tests/* debian/tmp/usr/lib/games/purity/
	ln -s ../purity/copyright debian/tmp/usr/doc/purity-off/copyright
#	dh_installdocs
	dh_installchangelogs
	dh_fixperms
	dh_gencontrol
	dh_installdeb
	dh_builddeb
	
define checkdir
	test -f debian/rules
endef

binary: binary-indep

checkroot:
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot
