#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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


# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)


clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp 
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif
	dh_clean 


install:
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs
	# aww, how silly
	test -d $(CURDIR)/debian/build || \
			mkdir $(CURDIR)/debian/build
	test -d $(CURDIR)/debian/build/usr || \
			mkdir $(CURDIR)/debian/build/usr
	test -d $(CURDIR)/debian/build/usr/lib || \
			mkdir $(CURDIR)/debian/build/usr/lib
	echo "load IPv6 module" >$(CURDIR)/debian/build/usr/lib/loadipv6


# Build architecture-independent files here.
binary-indep: build install


# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_install --sourcedir=debian/build
	dh_installinit -- start 15 2 3 4 . stop 20 0 1 5 6 .
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


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