#! /usr/bin/make -f
%:
	dh $@

export DEB_BUILD_MAINT_OPTIONS := hardening=+all
export DEB_CFLAGS_MAINT_APPEND := -Wall

override_dh_auto_configure:
	dh_auto_configure -- CFLAGS="$(CPPFLAGS) $(CFLAGS)"

override_dh_auto_install:
	dh_auto_install -- \
		prefix=$(CURDIR)/debian/exuberant-ctags/usr \
		CTAGS_PROG=ctags-exuberant

override_dh_installchangelogs:
	dh_installchangelogs NEWS

# git clones do not contain git-svn metadata.  This can be used to set it
# back up if you need it.
git-svn-setup:
	set -e; if [ -d .git ] && [ ! -d .git/svn ]; then \
		git config svn-remote.svn.url svn://svn.code.sf.net/p/ctags/code; \
		git config svn-remote.svn.fetch trunk:refs/remotes/svn/trunk; \
		git config svn-remote.svn.branches 'branches/*:refs/remotes/svn/*'; \
		git config svn-remote.svn.tags 'tags/*:refs/remotes/svn/tags/*'; \
		git update-ref refs/remotes/svn/trunk "$$(git log -n1 --grep git-svn-id: --format=%H)"; \
		git svn fetch; \
	fi