# -*- 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
# $Id: Portfile 80154 2011-07-05 16:29:01Z ciserlohn@macports.org $

PortSystem          1.0

name                play
conflicts           sox
version             1.2.2
categories          devel java www
platforms           darwin
license             Apache-2
maintainers         ciserlohn
supported_archs     noarch

description         Rapid webapplication development framework

long_description    The Play framework is a clean alternative to bloated Enterprise Java stacks. \
                    It focuses on developer productivity and targets RESTful architectures. \
                    Play is a perfect companion to agile software development. \
                    Play is a pure Java framework and allows you to keep your preferred \
                    development tools and libraries. If you already use Java as a  \
                    development platform you don't need to switch to another language, \
                    another IDE and other libraries. \
                    The Play framework's goal is to ease web applications \
                    development while sticking with Java. (From the documentation)

homepage            http://www.playframework.org/
master_sites        https://github.com/playframework/play/tarball/${version}

checksums           sha1    1ebc9f02e3204258966ff8e6226a7ddb7c8bb2e2 \
                    rmd160  7a9984b800eaf699bcdea99e60e47bab8a7e99f9

post-extract {
    file rename [glob ${workpath}/playframework-play-*] ${worksrcpath}

    # delete windows specific files
    delete ${worksrcpath}/play.bat ${worksrcpath}/python
}

patchfiles          patch-framework-build.xml.diff

use_configure       no

build.cmd           ant
build.target        package
build.dir           ${worksrcpath}/framework

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/java/${distname}
    file attributes ${build.dir}/dist/play -permissions rwxr-xr-x
    foreach f [glob -directory ${build.dir}/dist *] {
        file copy $f ${destroot}${prefix}/share/java/${distname}
    }

    # symlink the binary
    ln -s ${prefix}/share/java/${distname}/play ${destroot}${prefix}/bin

    # symlink the documentation
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    ln -s ${prefix}/share/java/${distname}/documentation/api ${docdir}
    ln -s ${prefix}/share/java/${distname}/samples-and-tests ${docdir}

}

livecheck.type      regex
livecheck.url       ${homepage}download
livecheck.regex     ${name}-(\\d+(\\.\\d+)*).zip
