# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 89365 2012-01-26 23:16:47Z dports@macports.org $

PortSystem      1.0

name            xmlto
version         0.0.25
categories      textproc
license         GPL-2+
installs_libs   no
platforms       darwin
maintainers     nomaintainer
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    https://fedorahosted.org/releases/x/m/xmlto/
use_bzip2       yes

checksums       rmd160  cba4f99be538cd08b73e9b1a6956c318f132284f \
                sha256  361cb70d5d0b4b753db00b67ed8bc1d53d0bc96c407d0310aefe854470b7e536

depends_run     port:coreutils \
                port:findutils \
                port:getopt \
                port:libpaper \
                port:libxml2 \
                port:libxslt \
                port:docbook-xml \
                port:docbook-xsl \
                port:fop

patchfiles      patch-xmlto.in.diff

configure.args  --mandir=${prefix}/share/man

configure.env-append \
    FIND=${prefix}/bin/gfind \
    GETOPT=${prefix}/bin/getopt \
    PAPER_CONF=${prefix}/bin/paperconf \
    TAIL=${prefix}/bin/gtail \
    XMLLINT=${prefix}/bin/xmllint \
    XMLTEX=${prefix}/bin/xmltex \
    DBLATEX=${prefix}/bin/dblatex \
    FOP=${prefix}/bin/fop

build.env-append      XML_CATALOG_FILES=${prefix}/etc/xml/catalog

destroot.env-append   ${build.env}

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

livecheck.type  regex
livecheck.url   https://fedorahosted.org/xmlto/browser/configure.in
livecheck.regex "\\($name,\\s*(\\d+(?:\\.\\d+)*)\\)"
