#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DEB_HOST_GNU_TYPE   := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

%:
	dh $@

override_dh_auto_clean:
	[ ! -f config.mk ] || dh_auto_clean

override_dh_auto_configure:
	dh_auto_configure -- --prefix= --libexecdir=/lib/dhcpcd \
		--mandir=/usr/share/man --dbdir=/var/lib/dhcpcd5 \
		--with-hooks=ntp --host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE)

override_dh_installinit:
	dh_installinit --name=dhcpcd --no-start

override_dh_install:
	dh_install
	mv debian/dhcpcd5/sbin/dhcpcd debian/dhcpcd5/sbin/dhcpcd5
	mv debian/dhcpcd5/usr/share/man/man8/dhcpcd.8 \
		debian/dhcpcd5/usr/share/man/man8/dhcpcd5.8
