#!/usr/bin/make -f

export LIBEXECDIR=/lib/resolvconf
DESTDIR=debian/openresolv
SRCDIR=debian

override_dh_auto_configure:
	dh_auto_configure -- --prefix= --libexecdir=/lib/resolvconf \
		--mandir=/usr/share/man

# These hooks should be moved to the respective packages.
# We supply them only to be a replacement to the resolvconf package.
override_dh_install:
	dh_install
	dh_installdirs etc/dhcp/dhclient-enter-hooks.d
	install -p --owner=root --group=root --mode=0644 ${SRCDIR}/dhclient \
		${DESTDIR}/etc/dhcp/dhclient-enter-hooks.d/resolvconf
	dh_installdirs etc/dhcp/dhclient-enter-hooks.d
	install -p --owner=root --group=root --mode=0644 ${SRCDIR}/dhclient \
		${DESTDIR}/etc/dhcp/dhclient-enter-hooks.d/resolvconf
	cat ${SRCDIR}/resolvconf.conf-debian >> ${DESTDIR}/etc/resolvconf.conf

override_dh_installifupdown:
	dh_installifupdown --name=000resolvconf
	dh_installifupdown --name=resolvconf

override_dh_installppp:
	dh_installppp --name=000resolvconf

%:
	dh $@
