From 249ab2480a77fae71c10849fb06df31b97f2061c Mon Sep 17 00:00:00 2001 From: Gabor Kovesdan Date: Thu, 31 Jan 2013 10:27:59 +0000 Subject: [PATCH] - Add experimental support for FOP-based PDF and PS rendering --- share/mk/doc.docbook.mk | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/share/mk/doc.docbook.mk b/share/mk/doc.docbook.mk index 90badc5e47..bae8e4222d 100644 --- a/share/mk/doc.docbook.mk +++ b/share/mk/doc.docbook.mk @@ -113,6 +113,9 @@ MASTERDOC?= ${.CURDIR}/${DOC}.xml # List of supported SP_ENCODINGs SP_ENCODING_LIST?= ISO-8859-2 KOI8-R +# Either jade or fop +PDFENGINE?= jade + .if defined(SPELLCHECK) DSLHTML?= ${DOC_PREFIX}/share/xml/spellcheck.dsl .endif @@ -136,6 +139,9 @@ JADE_ENV+= SP_ENCODING=${SP_ENCODING} .endif JADE_CMD= ${SETENV} ${JADE_ENV} ${JADE} +FOP?= ${PREFIX}/bin/fop +FOPOPTS?= + DSLHTML?= ${DOC_PREFIX}/share/xml/default.dsl DSLPRINT?= ${DOC_PREFIX}/share/xml/default.dsl DSLPGP?= ${DOC_PREFIX}/share/xml/pgp.dsl @@ -370,14 +376,15 @@ CLEANFILES+= ${DOC}.rtf-nopng CLEANFILES+= ${DOC}.aux ${DOC}.log .elif ${_cf} == "ps" -CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-ps ${DOC}.tex ${DOC}.tex-tmp +CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-ps \ + ${DOC}.tex ${DOC}.tex-tmp ${DOC}.fo .for _curimage in ${LOCAL_IMAGES_EPS:M*share*} CLEANFILES+= ${_curimage:T} ${_curimage:H:T}/${_curimage:T} .endfor .elif ${_cf} == "pdf" CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-pdf ${DOC}.tex-pdf-tmp \ - ${DOC}.tex + ${DOC}.tex ${DOC}.fo .for _curimage in ${IMAGES_PDF:M*share*} CLEANFILES+= ${_curimage:T} ${_curimage:H:T}/${_curimage:T} .endfor @@ -564,6 +571,7 @@ ${DOC}.rtf: # PS/PDF ----------------------------------------------------------------- +.if ${PDFENGINE} == "jade" .if !defined(NO_TEX) # # This sucks, but there's no way round it. The PS and PDF formats need @@ -643,6 +651,19 @@ ${DOC}.tex-pdf: .endif .endif +.elif ${PDFENGINE} == "fop" +${DOC}.fo: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} + ${GEN_INDEX_SGML_CMD} + ${XSLTPROC} ${XSLTPROCOPTS} ${XSLFO} ${DOC}.xml > ${.TARGET} + +${DOC}.pdf: ${DOC}.fo ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} + ${FOP} ${FOPOPTS} ${DOC}.fo ${.TARGET} + +${DOC}.ps: ${DOC}.fo ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} + ${FOP} ${FOPOPTS} ${DOC}.fo ${.TARGET} + +.endif + ${DOC}.tar: ${SRCS} ${LOCAL_IMAGES} ${LOCAL_CSS_SHEET} ${TAR} cf ${.TARGET} -C ${.CURDIR} ${SRCS} \ -C ${.OBJDIR} ${IMAGES} ${CSS_SHEET:T}