#!/usr/bin/make -f

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

# Warning on all
export DEB_CFLAGS_MAINT_APPEND  := -Wall
# More hardening
export DEB_BUILD_MAINT_OPTIONS  := hardening=+bindnow

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
		--prefix=/usr \
		--includedir=/usr/include \
		--sysconfdir=/etc/c-icap \
		--localstatedir=/var \
		--libexecdir=/usr/lib/$(DEB_HOST_MULTIARCH)/c_icap

override_dh_fixperms:
	dh_fixperms
	chmod 0644 debian/c-icap/etc/c-icap/*

override_dh_install:
	/usr/bin/chrpath -d debian/tmp/usr/bin/c-icap
	/usr/bin/chrpath -d debian/tmp/usr/bin/c-icap-client
	/usr/bin/chrpath -d debian/tmp/usr/bin/c-icap-mkbdb
	dh_install
	rm $(CURDIR)/debian/c-icap/usr/lib/*/c_icap/*.la

	
.PHONY: override_dh_strip
override_dh_strip:
	dh_strip --dbg-package=libicapapi3-dbg

