# -*- 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

PortSystem          1.0

name                xmlto
version             0.0.28
revision            8
categories          textproc
license             GPL-2+
installs_libs       no
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            https://pagure.io/xmlto
master_sites        https://releases.pagure.org/xmlto/
use_bzip2           yes

checksums           rmd160  acba3cc9ff46505ae49b91108c611646aeac2b5d \
                    sha256  1130df3a7957eb9f6f0d29e4aa1c75732a7dfb6d639be013859b5c7ec5421276 \
                    size    127921

depends_build       port:util-linux

depends_run         port:docbook-xml \
                    port:docbook-xsl-nons \
                    port:fop \
                    port:libpaper-utils \
                    port:libxml2 \
                    port:libxslt \
                    port:w3m \
                    port:util-linux

patchfiles          searchpath_local.patch \
                    xmlif.l.patch \
                    xml-catalog.patch

configure.env-append \
    GETOPT=${prefix}/bin/getopt \
    PAPER_CONF=${prefix}/bin/paperconf \
    XMLLINT=${prefix}/bin/xmllint \
    XSLTPROC=${prefix}/bin/xsltproc \
    FOP=${prefix}/bin/fop \
    W3M=${prefix}/bin/w3m

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}
    xinstall -m 0644 {*}[glob ${worksrcpath}/doc/*] ${destroot}${docdir}
}

test.run            yes
test.target         check

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
