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

PortSystem      1.0

name            spring-framework30
version         3.0.7
revision        1
set full_version ${version}.RELEASE

categories      java
license         Apache-2
maintainers     nomaintainer
supported_archs noarch
platforms       any

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       rmd160  b35c1c60b8c1b90fc459b5a6daacf920ad54ee5b \
                sha256  cbb482ab52d95506fa72273d9b09173a5afd1765f4279bf36d0151f973aea8d7 \
                size    49158669

use_zip         yes

conflicts       spring-framework31
depends_lib     bin:java:kaffe

use_configure   no

worksrcdir      spring-framework-${full_version}

build {}

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
}
