# -*- 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
PortGroup           java 1.0

name                apache-ivy
version             2.6.0
categories          devel java
platforms           any
supported_archs     noarch
license             Apache-2
maintainers         nomaintainer

description         Dependency manager for Apache Ant
long_description    Apache Ivy is a transitive dependency manager that \
                    is designed to integrate with Apache Ant. An \
                    external XML file defines project dependencies and \
                    lists the resources necessary to build a project. \
                    Ivy then resolves and downloads resources from an \
                    artifact repository: either a private repository \
                    or one publicly available on the Internet.
homepage            https://ant.apache.org/ivy

master_sites        apache:ant/ivy/${version}
distname            ${name}-${version}-src
worksrcdir          ${name}-${version}

checksums           rmd160  d96696b2c731af8e1ad468aed5127be4cf6dd6d5 \
                    sha256  7a1c4056af114ef7ed61f3665a614ce7085a442d5712a85a5bbebf84b217d29c \
                    size    2757508

depends_build       bin:ant:apache-ant

java.version        1.8+
java.fallback       openjdk25

use_configure       no

build.cmd           ant
build.target        /localivy \
                    /nojavadoc \
                    jar

destroot {
    set destdocdir  ${destroot}${prefix}/share/doc/${name}
    set destjavadir ${destroot}${prefix}/share/java

    xinstall -d ${destjavadir}
    xinstall -m 644 \
        ${worksrcpath}/build/artifact/jars/ivy.jar \
        ${destjavadir}/ivy.jar

    xinstall -d ${destdocdir}
    xinstall -m 644 \
        ${worksrcpath}/LICENSE \
        ${worksrcpath}/NOTICE \
        ${worksrcpath}/README.adoc \
        ${destdocdir}
    copy \
        {*}[glob -directory ${worksrcpath}/asciidoc *] \
        ${destdocdir}
}

livecheck.type      regex
livecheck.url       https://ant.apache.org/ivy/download.cgi
livecheck.regex     "${name}-(\\d+(\\.\\d+)*)(-\[a-z]+)*\\.tar\\.gz"
