# $Id: Portfile 51387 2009-05-23 23:12:27Z macsforever2000@macports.org $

PortSystem 1.0

name                griffon
version             0.1.1
categories          devel java
maintainers         nomaintainer
platforms           darwin

description         Griffon is a Grails like application framework for developing desktop applications in Groovy.
long_description    Griffon aims to bring the "coding by convention" paradigm to Groovy. \
                    It is an open-source application framework that leverages the Groovy \
                    language and complements Java desktop development. \
                    You can use Griffon as a standalone development environment that hides all \
                    configuration details or integrate your Java business logic. \
                    Griffon aims to make development as simple as possible and hence \
                    should appeal to a wide range of developers not just those from the Java community.

homepage            http://griffon.codehaus.org/
distname            ${name}-bin-${version}
master_sites        http://dist.codehaus.org/griffon/griffon/0.1.x

checksums           md5 0450ce0ef96317fc1d61b27b30360bdb \
                    sha1 9a63adb16f643f236c3351282d474e041d74d58d \
                    rmd160 827178c639897bbea112a48d1581d19f47343d13

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

use_bzip2           no
use_configure       no

build.cmd           true

pre-destroot {
    # Remove extraneous bat files
    foreach f [glob -directory ${worksrcpath}${workTarget}/bin *.bat] {
        file delete $f
    }
}

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

    # Copy over the needed elements of our directory tree
    file copy ${worksrcpath}/bin                            \
              ${worksrcpath}/dist                           \
              ${worksrcpath}/conf                           \
              ${worksrcpath}/lib                            \
              ${worksrcpath}/media                          \
              ${worksrcpath}/scripts                        \
              ${worksrcpath}/src                            \
              ${worksrcpath}/build.properties               \
              ${destroot}${prefix}/share/java/${name}

    # Symlink grails into the bin directory
    system "cd ${destroot}${prefix}/bin && ln -s ${prefix}/share/java/${name}/bin/griffon"
    system "cd ${destroot}${prefix}/bin && ln -s ${prefix}/share/java/${name}/bin/startGriffon"
}

post-activate {
    ui_msg "****************************************************************************"
    ui_msg "* Remember to set the environment variable GRIFFON_HOME to the path to"
    ui_msg "* the griffon distribution: ${prefix}/share/java/${name}"
    ui_msg "****************************************************************************"
 }
