#!/usr/bin/make -f

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

# This is the debhelper compatability version to use.
export DH_COMPAT=3

build: build-stamp

build-stamp: 
	dh_testdir

	# ensure our SGML is valid
	nsgmls -gues project-history.sgml
	nsgmls -gues project-history.fr.sgml
	nsgmls -gues project-history.ru.sgml

	# make HTML out of it
	debiandoc2html project-history.sgml
	debiandoc2html project-history.fr.sgml
	debiandoc2html project-history.ru.sgml

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp 

	rm -rf project-history.html \
		project-history.fr.html project-history.ru.html

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	install -m 644 project-history.html/*.html \
		debian/debian-history/usr/share/doc/debian-history/en
	install -m 644 project-history.fr.html/*.html \
		debian/debian-history/usr/share/doc/debian-history/fr
	install -m 644 project-history.ru.html/*.html \
		debian/debian-history/usr/share/doc/debian-history/ru

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

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