#!/usr/bin/make -f
# -*-makefile-*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.

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

# policy manual, section 10.1
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
     COPTS = -g -O0 -Wall -W -DENABLE_INFO_COMPAT
else
     COPTS = -g -O2 -Wall -W -DENABLE_INFO_COMPAT
endif


configure-stamp:
	dh_testdir
	touch configure-stamp

build: configure-stamp
	dh_testdir
	$(MAKE)  COPTS="$(COPTS)"
	touch build-stamp

clean: 
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	rm -f *.o core *.core *~ dhcpcd
	dh_clean -Pdebian/tmp

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build
#	dh_testversion
	dh_testdir
	dh_testroot
	dh_clean -k -Pdebian/tmp
	dh_installdirs -Pdebian/tmp

	install dhcpcd debian/tmp/sbin/dhcpcd-bin
	install debian/dhcpcd debian/tmp/sbin/dhcpcd3
	install -m 644 debian/config debian/tmp/etc/default/dhcpcd
	install debian/dhcpcd.sh debian/tmp/etc
	install -d debian/tmp/var/lib/dhcpc

	dh_installdocs -Pdebian/tmp README
	dh_installchangelogs  -Pdebian/tmp 

	install dhcpcd.8 debian/tmp/usr/share/man/man8/dhcpcd-bin.8
	install debian/dhcpcd.8 debian/tmp/usr/share/man/man8/dhcpcd3.8
	gzip -9 debian/tmp/usr/share/man/man8/dhcpcd-bin.8
	gzip -9 debian/tmp/usr/share/man/man8/dhcpcd3.8

	dh_strip -Pdebian/tmp
	dh_compress -Pdebian/tmp 
	dh_fixperms -Pdebian/tmp
	dh_installdeb -Pdebian/tmp
	dh_shlibdeps -Pdebian/tmp
	dh_gencontrol -Pdebian/tmp
	dh_md5sums -Pdebian/tmp
	dh_builddeb -Pdebian/tmp

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary




