#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_test:
	# ack behaves differently, causing the tests to fail
	[ ! -t 0 ] || dh_auto_test

override_dh_auto_clean:
	[ ! -f Makefile ] || touch Makefile
	dh_auto_clean

override_dh_clean:
	dh_clean --exclude=t/swamp/
	# make things partly sane for me :)
	[ ! -d .git -o ! -x /usr/bin/git ] || git checkout ack ack-help.txt

override_dh_auto_install:
	if [ -f blib/man1/ack-base.1p ]; then sed 's/ACK-BASE/ACK-GREP/g' blib/man1/ack-base.1p > blib/man1/ack-grep.1p; rm blib/man1/ack-base.1p; fi
	dh_auto_install

override_dh_fixperms:
	mv debian/ack-grep/usr/bin/ack-base debian/ack-grep/usr/bin/ack-grep
	rm -f debian/ack-grep/usr/share/man/man1/ack-base.1p.gz
	mv etc/ack.bash_completion.sh debian/ack-grep.bash-completion
	dh_bash-completion
	mv debian/ack-grep.bash-completion etc/ack.bash_completion.sh
	dh_fixperms
