svn commit: r40841 - projects/xml-tools/share/mk

Gabor Kovesdan gabor at FreeBSD.org
Thu Jan 31 10:28:00 UTC 2013


Author: gabor
Date: Thu Jan 31 10:27:59 2013
New Revision: 40841
URL: http://svnweb.freebsd.org/changeset/doc/40841

Log:
  - Add experimental support for FOP-based PDF and PS rendering

Modified:
  projects/xml-tools/share/mk/doc.docbook.mk

Modified: projects/xml-tools/share/mk/doc.docbook.mk
==============================================================================
--- projects/xml-tools/share/mk/doc.docbook.mk	Thu Jan 31 10:15:46 2013	(r40840)
+++ projects/xml-tools/share/mk/doc.docbook.mk	Thu Jan 31 10:27:59 2013	(r40841)
@@ -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}


More information about the svn-doc-projects mailing list