# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0

name                saxon
version             9.5.1.1
set branch          [join [lrange [split ${version} .] 0 1] .]
set dashed_version  [string map {. -} ${version}]
set dashed_branch   [string map {. -} ${branch}]
categories          textproc java
license             MPL-1
maintainers         nomaintainer

supported_archs     noarch

description         saxon home edition - collection of tools to process XML documents

long_description \
    Saxon-HE provides implementations of XSLT 2.0, XQuery 1.0, \
    and XPath 2.0 at the basic level of conformance defined by W3C.

platforms           any

homepage            http://saxon.sourceforge.net/
master_sites        sourceforge:project/saxon/Saxon-HE/${branch}
use_zip             yes
distname            [string toupper ${name} 0 0]HE${dashed_version}J
set jardistfile     ${distname}${extract.suffix}
set docdistfile     ${name}-resources${dashed_branch}${extract.suffix}
distfiles           ${jardistfile} ${docdistfile}

checksums           ${jardistfile} \
                        rmd160  af67cae4b9caaceb44837dc0df2ef216aeb83681 \
                        sha256  0e2b625264128593e8c05a1672691d093b4a54923cf9f59d442764101712636a \
                    ${docdistfile} \
                        rmd160  4b58fbfcd7c6fec60f0b91fe23d9f9cc22042980 \
                        sha256  7cdbcfc4d88015f6f53bef3b25e78c3447e0fc18d268307159be0595399881e2

depends_lib         bin:java:kaffe

extract.mkdir       yes

use_configure       no

build               {}

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc \
        ${destroot}${prefix}/share/java ${destroot}${prefix}/share/${name}
    xinstall -m 644 {*}[glob ${worksrcpath}/*.jar] \
        ${destroot}${prefix}/share/java
    copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
    copy ${worksrcpath}/samples ${worksrcpath}/source-userdoc.zip \
        ${worksrcpath}/use-cases ${destroot}${prefix}/share/${name}
}

livecheck.type      regex
livecheck.url       ${homepage}
# The current maintenance\n
livecheck.regex     "release on the 9\\.\[0-9\] branch is (\\d+(?:\\.\\d+)*)"