Bug 53173 - [NEW PORT] textproc/xmlto: Front-end to an XSL toolchain
Summary: [NEW PORT] textproc/xmlto: Front-end to an XSL toolchain
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-11 01:10 UTC by Sergei Kolobov
Modified: 2003-06-20 17:29 UTC (History)
0 users

See Also:


Attachments
xmlto.shar (3.75 KB, text/plain)
2003-06-11 01:10 UTC, Sergei Kolobov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Kolobov 2003-06-11 01:10:09 UTC
xmlto is a front-end to an XSL toolchain. It chooses an appropriate
stylesheet for the conversion you want and applies it using an external
XSL-T processor.  It also performs any necessary post-processing.

Supported conversions from DocBook XML: dvi, fo, html, html-nochunks,
htmlhelp, javahelp, man, pdf, ps, txt, xhtml, xhtml-nochunks.

Currently the only XSL-T processor supported is xsltproc (textproc/libxslt).
For DVI, PDF and PostScript output, PassiveTeX (print/passivetex) is required.

Author:	Tim Waugh <tim@cyberelk.net>
WWW:	http://cyberelk.net/tim/xmlto/

This port requires misc/getopt (submitted separately) and is required for
update of devel/makeplus port.

Tested on 4.8-STABLE and 5.1-CURRENT (i386).
Comment 1 Sergei Kolobov 2003-06-20 13:56:08 UTC
The patch below fixes (finally) xmlto port:
- avoid fetching DocBook XSL stylesheets via HTTP by redirecting to the
  installed docbook-xsl port; add dependency

--- Makefile.orig	Tue Jun 17 12:50:46 2003
+++ Makefile	Fri Jun 20 16:49:55 2003
@@ -19,7 +19,8 @@
 BUILD_DEPENDS=	${BASH_CMD}:${PORTSDIR}/shells/bash2 \
 		${GETOPT_CMD}:${PORTSDIR}/misc/getopt \
 		xmllint:${PORTSDIR}/textproc/libxml2 \
-		xsltproc:${PORTSDIR}/textproc/libxslt
+		xsltproc:${PORTSDIR}/textproc/libxslt \
+		${XSL_DIR}:${PORTSDIR}/textproc/docbook-xsl
 RUN_DEPENDS=	${BUILD_DEPENDS}
 
 .if defined(WITH_PASSIVETEX) || exists(${PASSIVETEX})
@@ -39,12 +40,16 @@
 GETOPT_CMD=	${LOCALBASE}/bin/getopt
 PASSIVETEX=	${LOCALBASE}/share/texmf/tex/passivetex
 
+XSL_URL=	http://docbook.sourceforge.net/release/xsl/current
+XSL_DIR=	${LOCALBASE}/share/xsl/docbook
+
 MAN1=		xmlif.1 xmlto.1
 DOCS=		AUTHORS NEWS
 
 do-patch:
-	${REINPLACE_CMD} -e 's,/bin/bash,${BASH_CMD},' -e '/--nonet/d' \
-		${WRKSRC}/xmlto.in
+	${REINPLACE_CMD} -e 's,/bin/bash,${BASH_CMD},' ${WRKSRC}/xmlto.in
+	${REINPLACE_CMD} -e 's,${XSL_URL},${XSL_DIR},' \
+		${WRKSRC}/format/docbook/*
 .if !defined(WITH_PASSIVETEX)
 	${REINPLACE_CMD} -e '/format\/fo\//d' ${WRKSRC}/Makefile.in
 .endif
Comment 2 Sergei Kolobov 2003-06-20 14:56:11 UTC
On 2003-06-20 at 17:30 +0400, Sergey A. Osokin wrote:
> Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd
> /usr/home/ports/src/xmlto/work/xmlto-0.0.14/./doc/xmlif.xml:4: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"

Oops, that escaped my testing since I had XML_CATALOG_FILES defined.
Use this patch (in addition to the previous one):

--- Makefile.orig2	Fri Jun 20 17:48:11 2003
+++ Makefile	Fri Jun 20 17:50:11 2003
@@ -40,6 +40,8 @@
 GETOPT_CMD=	${LOCALBASE}/bin/getopt
 PASSIVETEX=	${LOCALBASE}/share/texmf/tex/passivetex
 
+DOCBOOK_URL=	http://www.oasis-open.org/docbook/xml
+DOCBOOK_DIR=	${LOCALBASE}/share/xml/docbook
 XSL_URL=	http://docbook.sourceforge.net/release/xsl/current
 XSL_DIR=	${LOCALBASE}/share/xsl/docbook
 
@@ -48,6 +50,8 @@
 
 do-patch:
 	${REINPLACE_CMD} -e 's,/bin/bash,${BASH_CMD},' ${WRKSRC}/xmlto.in
+	${REINPLACE_CMD} -e 's,${DOCBOOK_URL},${DOCBOOK_DIR},' \
+		${WRKSRC}/doc/xml*.xml
 	${REINPLACE_CMD} -e 's,${XSL_URL},${XSL_DIR},' \
 		${WRKSRC}/format/docbook/*
 .if !defined(WITH_PASSIVETEX)

> file:///usr/local/share/xml/catalog:1: error: Start tag expected, '<' not found
> CATALOG "dtd/catalog"
> ^

For some reason, it expects an XML catalog at that location, but it isn't.
Nonetheless, it should not affect the build.

Sergei
Comment 3 Sergey A. Osokin freebsd_committer freebsd_triage 2003-06-20 17:29:02 UTC
State Changed
From-To: open->closed

Committed, thanks!