# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem          1.0

name                jmol
version             11.6.17
categories          science
platforms           darwin
maintainers         simon openmaintainer
description         An open-source Java viewer for chemical structures in 3D
long_description    Jmol is a free, open source molecule viewer for \
                    students, educators, and researchers in chemistry and \
                    biochemistry. \
                    \
                    This port only installs the Jmol application, not the \
                    applet or developer version. If you want to use it, \
                    please download it from the Jmol homepage.

homepage            http://jmol.sourceforge.net/
master_sites        sourceforge

distname            ${name}-${version}-binary
checksums           md5 599b34d7fab9f64277f3bd952775718c \
                    sha1 64214ce1f4ccbc6cec860aedcb7022bcf60a8ec5 \
                    rmd160 bf364b2f5770fab424abf057e7f078c95f9feb16
worksrcdir          ${name}-${version}

depends_run         bin:java:kaffe

use_configure       no

post-patch {
    reinplace "s|/usr/share/jmol/|${prefix}/share/java/jmol/|g" \
        ${worksrcpath}/jmol
}

build {}

destroot {
    # install the jmol script:
    xinstall ${worksrcpath}/jmol ${destroot}${prefix}/bin
    # install the jmol java files:
    xinstall -d ${destroot}${prefix}/share/java/jmol
    foreach jar [glob ${worksrcpath}/*.jar] {
        xinstall $jar ${destroot}${prefix}/share/java/jmol
    }
    # install doc files:
    xinstall -d ${destroot}${prefix}/share/doc/jmol-${version}
    foreach doc {CHANGES.txt COPYRIGHT.txt LEAME.txt LICENSE.txt README.txt} {
        xinstall ${worksrcpath}/$doc \
                 ${destroot}${prefix}/share/doc/jmol-${version}
    }
}

livecheck.type      regex
livecheck.url       http://sourceforge.net/project/showfiles.php?group_id=23629
livecheck.regex     {Version (\d+[0-9a-zA-Z.]+)}
