#!/usr/bin/make -f
#export DH_VERBOSE=1

PACKAGE  = sgml-base-doc
PKG_DOCS = sgml_layout.html sgml_layout.pdf sgml_layout.txt

# Ensure reproducible date
export DEBIANDOC_DATE = $(shell date --utc --date=@$(SOURCE_DATE_EPOCH) '+%Y-%m-%d')

.SUFFIXES: .html .pdf .sgml .txt
.sgml.html:
	debiandoc2html $<
.sgml.pdf:
	debiandoc2latexpdf -p letter $^
.sgml.txt:
	debiandoc2text $^

override_dh_auto_test: sgml_layout.sgml
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	onsgmls -wall -E20 -gues $<
endif

override_dh_auto_build: $(PKG_DOCS)

%:
	dh $@

override_dh_clean:
	$(RM) -r $(PKG_DOCS) sgml_layout.tpt
	dh_clean
