#!/usr/bin/make -f
## ----------------------------------------------------------------------
## debian/rules : package build and install script for debiandoc-sgml-doc-pt-br
## ----------------------------------------------------------------------

## ----------------------------------------------------------------------
## uncomment this to turn on verbose mode
#export DH_VERBOSE=1

## ----------------------------------------------------------------------
## Document definitions
doc_name	= debiandoc-sgml
doc_lang	= pt_BR
doc_sgml	= $(doc_name).$(doc_lang).sgml
doc_pdf		= $(doc_name).$(doc_lang).pdf
doc_txt		= $(doc_name).$(doc_lang).txt
doc_html	= $(doc_name).html

## ----------------------------------------------------------------------
## General directory definitions
prefix		= debian/tmp
share_dir	= $(prefix)/usr/share
doc_dir		= $(share_dir)/doc

## ----------------------------------------------------------------------
## Package directory definitions
pkg_name 	= $(doc_name)-doc-pt-br
pkg_html	= $(pkg_name).html
pkg_doc_dir	= $(doc_dir)/$(pkg_name)
pkg_html_dir	= $(pkg_doc_dir)/$(pkg_html)

## ----------------------------------------------------------------------
## Targets

build:		build-stamp
build-stamp:	$(doc_sgml)
		dh_testdir
		nsgmls -wall -E20 -gues $^
		debiandoc2html -l $(doc_lang) -b $(doc_name) -c $^
		ln -sf index.pt-br.html $(doc_html)/index.html
		debiandoc2latexpdf -l $(doc_lang) -p letter $^
		debiandoc2text -l $(doc_lang) $^
		touch build-stamp

clean:
		dh_testdir
		dh_testroot
		rm -rf $(doc_html) $(doc_pdf) $(doc_txt)
		dh_clean
		rm -f build-stamp

binary-indep:	build
		dh_testdir
		dh_testroot
		dh_clean
		dh_installdirs
		cp -af debian/dhelp $(doc_html)/.dhelp
		dh_installdocs $(doc_sgml) $(doc_lang) \
				$(doc_html) $(doc_pdf) $(doc_txt)
		dh_installchangelogs
		dh_compress
		dh_fixperms
		dh_installdeb
		dh_gencontrol
		dh_md5sums
		dh_builddeb

binary-arch:

binary:		binary-indep binary-arch

.PHONY:		clean binary-indep binary-arch binary

## ----------------------------------------------------------------------
