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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           java 1.0

github.setup        grails grails-core 6.1.2 v
github.tarball_from releases
revision            0
name                grails

categories          devel java
license             Apache-2
platforms           any
supported_archs     noarch
maintainers         {judaew @judaew} openmaintainer

description         Groovy on rails, web framework
long_description    A powerful Groovy-based web application framework for the \
                    JVM built on top of Spring Boot
homepage            https://grails.org/

distname            ${name}-${version}

checksums           rmd160  c7b078f51e3f6ba7922fbc7648394c834db1e542 \
                    sha256  3e889766e0096cab3205155ac70b0a4838750733d89600307bfc42d2a7de0e0b \
                    size    186132637

use_zip             yes
use_configure       no

java.version        1.8+
java.fallback       openjdk8

build {}

pre-destroot {
    # Remove extraneous bat files
    delete ${worksrcpath}/bin/grails.bat
}

destroot    {
    # Create the target java directory
    xinstall -m 755 -d ${destroot}${prefix}/share/java/${name}

    # Copy over the needed elements of our directory tree
    move ${worksrcpath}/bin \
        ${worksrcpath}/dist \
        ${worksrcpath}/lib \
        ${worksrcpath}/media \
        ${worksrcpath}/src \
        ${worksrcpath}/LICENSE \
        ${destroot}${prefix}/share/java/${name}

    # Symlink grails into the bin directory
    ln -s ${prefix}/share/java/${name}/bin/grails ${destroot}${prefix}/bin
}

notes "
Remember to set the environment variable GRAILS_HOME to the path to\
the grails distribution: ${prefix}/share/java/${name}
"

github.livecheck.regex {([0-9.-]+)}
