# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 76328 2011-02-20 09:27:42Z blb@macports.org $

PortSystem          1.0

name                fantom
version             1.0.57
revision            0

categories          java lang devel
maintainers         hum.ph:m
platforms           darwin

description         The Language Formerly Known as Fan.
long_description    Fantom is designed as a practical programming \
                    language to make it easy and fun to get real work \
                    done. It is not an academic language to explore \
                    bleeding edge theories, but based on solid real \
                    world experience. During its design we set out to \
                    solve what we perceived were some real problems \
                    with Java and C#.

homepage            http://fantom.org/

master_sites        http://fan.googlecode.com/files/
use_zip             yes

checksums           md5    5f5b7fbaae4e2cf76ded359c57530af2 \
                    sha1   4aba26250d525b8a0e9d20fb792c1e108f7c52a6 \
                    rmd160 4cc371adb5eb6dfa9ee836ddd18c283f06872017

depends_build       bin:java:kaffe

use_configure       no

build               {}

destroot {

    set fantomdir ${destroot}${prefix}/share/java/${name}

    xinstall -m 755 -d ${fantomdir}

    file copy ${worksrcpath}/adm \
              ${worksrcpath}/bin \
              ${worksrcpath}/doc \
              ${worksrcpath}/etc \
              ${worksrcpath}/examples \
              ${worksrcpath}/lib \
              ${worksrcpath}/src \
              ${fantomdir}

    foreach f [glob -directory ${fantomdir}/bin *.exe] {
        file delete $f
    }

    foreach f [glob -directory ${fantomdir}/bin *] {
        set basename [file tail $f]
        file attributes $f -permissions +x
        file link -s ${destroot}${prefix}/bin/${basename} ../share/java/${name}/bin/${basename}
    }


}

notes               "
To use fantom, add the following lines at the end of your .bash_profile:

    export FAN_HOME=${prefix}/share/java/${name}
    export FAN_ENV=util::PathEnv
    export FAN_ENV_PATH=~/.fan/

and:

    mkdir ~/.fan
"
