# $Id: Portfile,v 1.3 2005/10/19 08:10:16 blb Exp $

PortSystem			1.0
name				xmlto
version				0.0.18
revision			1
categories			textproc
maintainers			blb@opendarwin.org
description			Convert an XML document to another format based on XSL \
					or other tools
long_description \
	The purpose of xmlto is to convert an XML file to the desired format \
	using whatever means necessary. This may involve two steps: \
		1. The application of an appropriate XSL stylesheet using an XSL-T \
			processor. \
		2. Further processing with other tools. This step may not be necessary.

homepage			http://cyberelk.net/tim/xmlto/
master_sites		http://cyberelk.net/tim/data/xmlto/stable/

platforms			darwin
use_bzip2			yes
checksums			md5 1a06471b70eb27a6aca5d1b3a144f9b0

depends_lib			bin:xsltproc:libxslt lib:libxml2.2:libxml2 \
					path:${prefix}/bin/getopt:getopt \
					path:${prefix}/share/xml/docbook-xml:docbook-xml \
					path:${prefix}/share/xsl/docbook-xsl:docbook-xsl

patchfiles			patch-doc_xmlif.xml patch-doc_xmlto.xml

configure.args		--with-getopt=${prefix}/bin/getopt \
					--mandir=${prefix}/share/man

post-configure {
	file copy ${filespath}/catalog.xml ${workpath}/catalog.xml
	reinplace "s|@@PREFIX@@|${prefix}|g" ${workpath}/catalog.xml
}

build.args			XML_CATALOG_FILES=${workpath}/catalog.xml

destroot.args		${build.args}

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
	eval xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog FAQ \
		NEWS README [glob ${worksrcpath}/doc/*] \
		${destroot}${prefix}/share/doc/${name}
}

