# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem    1.0
name          tom
version       2.5

description      Tom is a pattern matching compiler developed at INRIA.
long_description Tom is a pattern matching compiler developed at INRIA.\
                 It is particularly well-suited for programming various \
                 transformations on  trees/terms and XML based documents.\
                 Its design follows our research on rule based languages (R3),\
                 and our experiences  on the efficient compilation of ELAN\
                 developed by the Protheo group.\
                 Don't forget to add `echo \${TOM_HOME}/lib/*.jar | tr ' ' ':'`\
                 to your CLASSPATH, TOM_HOME being ${prefix}/share/java/tom-${version}
platforms        darwin freebsd linux
categories       lang
maintainers      loria.fr:reilles
homepage         http://tom.loria.fr/
master_sites	 http://gforge.inria.fr/frs/download.php/2433/
distname 	 ${name}-src-${version}
checksums	 md5 5891867d25173f390ce093da87d8fcba
depends_build    bin:ant:apache-ant

use_configure    no

build.cmd        ./build.sh
build.target     stable

destroot  {
    xinstall -m 755 -d ${destroot}${prefix}/share/java
    file copy ${worksrcpath}/stable/dist/ ${destroot}${prefix}/share/java/${name}-${version}
    file delete ${destroot}${prefix}/share/java/${name}-${version}/doc
    file copy ${worksrcpath}/stable/dist/share/man/man1/tom.1 ${destroot}${prefix}/share/man/man1/
    file copy ${worksrcpath}/stable/dist/share/man/man1/gom.1 ${destroot}${prefix}/share/man/man1/
    file delete ${destroot}${prefix}/share/java/${name}-${version}/man/man1/tom.1
    file delete ${destroot}${prefix}/share/java/${name}-${version}/man/man1/gom.1

    system "ln -fs ${prefix}/share/java/${name}-${version}/bin/tom \
      ${destroot}${prefix}/bin/tom"
    system "ln -fs ${prefix}/share/java/${name}-${version}/bin/gom \
      ${destroot}${prefix}/bin/gom"
}

