#!/usr/bin/make -f
# debian/rules for tig
#
# Written by Sebastian Harl <tokkee@debian.org>

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export DESTDIR=$(CURDIR)/debian/tig

%:
	dh $@

execute_after_dh_auto_build:
	$(MAKE) doc

execute_after_dh_auto_install:
	$(MAKE) install-doc
	rm $(DESTDIR)/usr/share/doc/tig/INSTALL.html
	rm $(DESTDIR)/usr/share/doc/tig/README.html

execute_after_dh_install:
	chmod -x $(DESTDIR)/usr/share/bash-completion/completions/tig

override_dh_auto_test:

override_dh_compress:
	dh_compress -X.pdf

override_dh_installchangelogs:
	dh_installchangelogs NEWS.adoc
