# -*- 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
PortGroup           github 1.0

github.setup        playframework play1 1.5.2
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
name                play
conflicts           sox
categories          devel java www
platforms           {darwin any}
license             Apache-2
maintainers         {ciserlohn @ci42}
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/

checksums           rmd160  f00eb64c2cfb4b15b314be2c0073dab71fefe63a \
                    sha256  1bb73052ab69867048bce482151665c0d009355d7ffcdd8be1d0b2fca910d2d6 \
                    size    84041185

depends_build       port:apache-ant

depends_lib         port:python27
depends_run         port:py27-simplejson \
                    port:py27-yaml

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

post-patch {
    reinplace "s|/usr/bin/env python|${prefix}/bin/python2.7|" ${worksrcpath}/play
}

use_configure       no

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

destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    set javadir ${destroot}${prefix}/share/java/${distname}
    set python_prefix ${destroot}${frameworks_dir}/Python.framework/Versions/2.7
    set pythondir ${python_prefix}/lib/python2.7/site-packages

    xinstall -m 755 -d ${docdir}
    xinstall -m 755 -d ${javadir}
    xinstall -m 755 -d ${pythondir}

    foreach f [list documentation samples-and-tests support] {
        file copy ${build.dir}/../${f} ${docdir}
    }
    file copy [glob -directory ${build.dir}/dist *] ${javadir}
    file copy ${worksrcpath}/framework/pym/play ${pythondir}
    xinstall -m 755 ${build.dir}/../play ${destroot}${prefix}/bin
}
