# -*- 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-ant
version                 1.10.14
revision                0
categories              devel java
license                 Apache-2 W3C
maintainers             nomaintainer
supported_archs         noarch

description             Java opensource build system
long_description        Ant is a Java based build tool. In theory it is \
                        kind of like make without make's wrinkles. Ant \
                        uses XML build files that define a set of targets. \
                        Each target has dependencies (other targets) \
                        and contains a set of tasks to perform.
homepage                https://ant.apache.org/

platforms               any

distname                ${name}-${version}-bin
master_sites            apache:ant/
master_sites.mirror_subdir      binaries
checksums               rmd160  ac7b60b5be0b1fa1e15abd2478e6f38dc9703ee9 \
                        sha256  a0456ecbf934b41dca74747413f2da7eafe40355fbdf5bfd38d8f3713dd828cd \
                        size    4844448

worksrcdir              ${name}-${version}
set workTarget          ""

use_xz                  yes
use_configure           no

conflicts               apache-ant-1.9

java.version            1.8+

build {}

pre-destroot {
        delete \
                ${worksrcpath}${workTarget}/bin/ant.bat \
                ${worksrcpath}${workTarget}/bin/ant.cmd \
                ${worksrcpath}${workTarget}/bin/antRun.bat \
                ${worksrcpath}${workTarget}/bin/antenv.cmd \
                ${worksrcpath}${workTarget}/bin/envset.cmd \
                ${worksrcpath}${workTarget}/bin/lcp.bat \
                ${worksrcpath}${workTarget}/bin/runrc.cmd
}

destroot        {
        xinstall -m 755 -d ${destroot}${prefix}/share/java
        file copy ${worksrcpath}${workTarget} \
                ${destroot}${prefix}/share/java/${name}

        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
        foreach f {INSTALL
                   KEYS
                   LICENSE
                   NOTICE
                   README
                   WHATSNEW
                   manual} {
            file rename ${destroot}${prefix}/share/java/${name}/${f} \
                ${destroot}${prefix}/share/doc/${name}/${f}
        }

        ln -s ../share/java/${name}/bin/ant ${destroot}${prefix}/bin/ant
}

livecheck.type          regex
livecheck.url           https://www.apache.org/dist/ant/binaries/
livecheck.regex         {apache-ant-(\d+(?:\.\d+)*)-bin\.tar\.bz2}
