#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

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

PACKAGEVERSION=4.71


build-arch: build-arch-stamp
build-arch-stamp:
	dh_testdir

	# Add here command to compile/build the package.

	touch build-arch-stamp

build-indep:  build-indep-stamp
build-indep-stamp:
	dh_testdir
	cp -a doc-docbook build-tree

	cd build-tree && \
		$(MAKE) DOCBOOK2TEXI=docbook2x-texi os-fixup && \
		$(MAKE) DOCBOOK2TEXI=docbook2x-texi spec.html filter.html \
			spec.info filter.info
	touch build-indep-stamp

build: build-stamp
#build-stamp: patch build-arch build-indep
build-stamp: build-arch build-indep

#clean: clean1 unpatch
clean: clean1
clean1:
	dh_testdir
	dh_testroot
	rm -rf build-stamp configure-stamp build-tree build-indep-stamp build-arch-stamp

	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	cp -a build-tree/index.html \
		$(CURDIR)/debian/exim4-doc-html/usr/share/doc/exim4-doc-html/html
	cp -a build-tree/filter.html* build-tree/spec_html* \
		$(CURDIR)/debian/exim4-doc-html/usr/share/doc/exim4-doc-html/html


# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installmenu -i
	dh_installinfo -i
	dh_installchangelogs  -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install


binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure \
	patch unpatch clean1
