# $Id$

PortSystem 1.0

name            groovy
version         2.4.7

categories      lang java
maintainers     breun.nl:nils openmaintainer
platforms       darwin
license         Apache-2
supported_archs noarch

description     Groovy -- a Java-based scripting language

long_description Groovy... \
                * is an agile and dynamic language for the Java Virtual Machine \
                * builds upon the strengths of Java but has additional power \
                  features inspired by languages like Python, Ruby and Smalltalk \
                * makes modern programming features available to Java developers \
                  with almost-zero learning curve \
                * provides the ability to statically type check and statically \
                  compile your code for robustness and performance \
                * supports Domain-Specific Languages and other compact syntax so \
                  your code becomes easy to read and maintain \
                * makes writing shell and build scripts easy with its powerful \
                  processing primitives, OO abilities and an Ant DSL \
                * increases developer productivity by reducing scaffolding code \
                  when developing web, GUI, database or console applications \
                * simplifies testing by supporting unit testing and mocking \
                  out-of-the-box \
                * seamlessly integrates with all existing Java classes and \
                  libraries \
                * compiles straight to Java bytecode so you can use it anywhere \
                  you can use Java

homepage        http://groovy-lang.org/
master_sites    https://dl.bintray.com/${name}/maven/
distname        apache-${name}-binary-${version}
use_zip         yes

checksums       rmd160  ba09b24ee7bd07b51724a48684ce4f3c7d0cba62 \
                sha256  438dd6098252647e88ff12ac5737d0d0f7e16a8e4e42e8be3e05a4c43abefbd5

worksrcdir      ${name}-${version}

use_configure   no

build {}

destroot {
    set target ${destroot}${prefix}/share/java/${name}

    # Create the target java directory
    xinstall -m 755 -d ${target}

    # Copy over the needed elements of our directory tree
    foreach d { bin conf embeddable indy lib } {
        copy ${worksrcpath}/${d} ${target}
    }

    # Remove extraneous bat files
    foreach f [glob -directory ${target}/bin *.bat] {
        delete ${f}
    }

    # Add symlinks to the scripts
    foreach f { grape groovy groovyConsole groovyc groovydoc groovysh java2groovy startGroovy } {
        ln -s ../share/java/${name}/bin/${f} ${destroot}${prefix}/bin
    }
}

livecheck.regex ${name}-binary-(\[\\d\.\]+)${extract.suffix}