# $Id: Portfile 67850 2010-05-19 19:12:57Z breskeby@macports.org $

PortSystem 1.0

name                griffon
version             0.3.1
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          devel java
maintainers         breskeby
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/
conflicts			griffon-devel
distname            ${name}-bin-${version}
master_sites        http://dist.codehaus.org/griffon/griffon/${branch}.x

checksums           md5 0eff6a7f8acbcf298f2cd381ffcc4352 \
                    sha1 ca091f3de53cab632166199dad2d6d4adb46905f \
                    rmd160 634c45c703cdb5101fc3228dc6ebebee0936effe

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

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}/bash                           \
              ${worksrcpath}/dist                           \
              ${worksrcpath}/conf                           \
              ${worksrcpath}/lib                            \
              ${worksrcpath}/scripts                        \
              ${worksrcpath}/src                            \
              ${worksrcpath}/build.properties               \
              ${destroot}${prefix}/share/java/${name}

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

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 "****************************************************************************"
 }
