#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk
include $(CURDIR)/debian/mk/docbook-xml-manpage.mk

DOCBOOKXML_MANPAGE_SOURCES = debian/xml-man/plastex.xml

# We are here going to build the documentation using ourself,
# and as we hasn't installed plastex yet, we are executing the
# plastex script in the source.
build/python-plastex-doc::
	if [ ! -d html ]; then \
		cd Doc; \
		export PYTHONPATH=..; \
		export TEXINPUTS=.:$(CURDIR)/Doc/commontex:$(CURDIR)/Doc/texinputs; \
		../plasTeX/plastex plastex.tex; \
		cd ..; \
		mv Doc/plastex html; \
	fi;

clean::
	rm -rf html
