# $Id: Portfile,v 1.6 2006/05/06 10:44:08 mww Exp $

PortSystem    1.0
name          tom
version       2.3

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      reilles@loria.fr
homepage         http://tom.loria.fr
master_sites	 http://gforge.inria.fr/frs/download.php/731/
distname 		 ${name}-src-${version}
checksums		md5 52d0191092aa8715b7cf018b20e1ffe2
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"
}

