PortSystem 1.0

name                griffon
version             1.2.0
set branch          [join [lrange [split ${version} .] 0 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/
conflicts			griffon-devel

distname            griffon-${version}-bin
master_sites        http://dist.codehaus.org/griffon/griffon/${branch}.x/
extract.suffix      .tgz

checksums           md5     ee8ec75e5c6c19c0ba8917a13cdc5fd2 \
                    sha1    ef9870d871080a634439789f7e7fb829ced3c34f \
                    rmd160  1d34bff8c1e0a580ae601a715f425508abf8a882

worksrcdir          .
set workTarget      ""
use_configure       no

build {}

pre-destroot {
    # Remove extraneous bat files
    foreach f [glob -directory ${worksrcpath}${workTarget}/griffon-${version}/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}/griffon-${version}/bash					\
              ${worksrcpath}/griffon-${version}/conf					\
              ${worksrcpath}/griffon-${version}/dist					\
              ${worksrcpath}/griffon-${version}/INSTALL					\
              ${worksrcpath}/griffon-${version}/lib						\
              ${worksrcpath}/griffon-${version}/LICENSE					\
              ${worksrcpath}/griffon-${version}/media					\
              ${worksrcpath}/griffon-${version}/src						\
              ${worksrcpath}/griffon-${version}/scripts					\
              ${destroot}${prefix}/share/java/${name}/

	xinstall -m 755 -d ${destroot}${prefix}/share/java/${name}/bin
	xinstall -m 755 {*}[glob ${worksrcpath}/griffon-${version}/bin/*] ${destroot}${prefix}/share/java/${name}/bin
   	
   	# 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 "****************************************************************************"
 }
