# $Id: Portfile 66075 2010-04-05 21:40:26Z blair@macports.org $

PortSystem 1.0

name                    spring-framework3
version                 3.0.2
set full_version        ${version}.RELEASE

categories              java
maintainers             blair
platforms               darwin

description             Spring application framework for Java
long_description        Spring is a layered Java/J2EE application framework.
homepage                http://www.springsource.org/about

distname                spring-framework-${full_version}-with-docs
master_sites            http://s3.amazonaws.com/dist.springframework.org/release/SPR
checksums               md5 ef3851d3592ec435074ff4ef315d40e4 \
                        sha1 67a7f80975a35018173899d87993085a2314a132 \
                        rmd160 fb8a42c0ea42cb877353f54b12044a133404e03f

use_zip                 yes

depends_lib             bin:java:kaffe

use_configure           no

worksrcdir              spring-framework-${full_version}

build.cmd               true

destroot {
        # Ensure needed directories
        xinstall -m 755 -d ${destroot}${prefix}/share \
                ${destroot}${prefix}/share/doc/${name} \
                ${destroot}${prefix}/share/examples

        # Install the framework
        file copy ${worksrcpath}/dist ${destroot}${prefix}/share/java
        foreach f [glob ${destroot}${prefix}/share/java/*.jar] {
                file rename ${f} [strsed ${f} s/-${full_version}//]
        }

        # Install the docs
        foreach f {changelog.txt license.txt notice.txt readme.txt} {
                file copy ${worksrcpath}/${f} \
                        ${destroot}${prefix}/share/doc/${name}/${f}
        }
        file copy ${worksrcpath}/docs/javadoc-api \
                ${destroot}${prefix}/share/doc/${name}/api
        file copy ${worksrcpath}/docs/spring-framework-reference \
                ${destroot}${prefix}/share/doc/${name}/reference
}
