#!/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


%:
	dh $@

build:
	dh build --before configure
	./configure --prefix=/usr \
		--includedir=/usr/include \
		--sysconfdir=/etc/c-icap \
		--localstatedir=/var \
		--libexecdir=/usr/lib/c_icap
	dh build --after configure

binary:
	dh binary --until dh_auto_install
	# use chrpath to remove RPATH from binaries
	/usr/bin/chrpath -d debian/tmp/usr/bin/c-icap
	/usr/bin/chrpath -d debian/tmp/usr/bin/c-icap-client
	dh binary --until dh_fixperms
	# dh_fixperms has run, now override it for one program
	chmod 0644 debian/c-icap/etc/c-icap/*
	# and continue
	dh binary

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

