# -*- 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
# $Id: Portfile 89339 2012-01-26 01:03:41Z nicos@macports.org $

PortSystem          1.0

name                jabref
version             2.7.2
revision            1
categories          java
platforms           darwin
license             GPL-2
maintainers         nicos openmaintainer

description         JabRef is an java-based bibliography reference manager. 
long_description    JabRef is an open source bibliography reference manager. \
                    The native file format used by JabRef is BibTeX, the standard \
                    LaTeX bibliography format.\

homepage            http://jabref.sourceforge.net/index.php
distname            JabRef-${version}-src
master_sites        sourceforge:project/jabref/jabref/${version}

checksums           sha1    aa55ccfcf58c4f168275104649e58e189e855044 \
                    rmd160  c68609d8f0960a53f4b11553280f448d0ed71a43

worksrcdir          ${name}-${version}

use_bzip2           yes

depends_build       port:apache-ant \
                    port:jarbundler

patchfiles          JabRefPreferences.java.diff \
                    OSXAdapter.java.diff

use_configure       no

build.cmd           ant
build.target        build osx

destroot.cmd        ant
destroot.target     jars osxjar
destroot.destdir    

pre-configure {
    #Using macports jarbundler
    reinplace "s|classpath=\"\${lib.dir}/jarbundler-2.2.0.jar\"|classpath=\"${prefix}/share/java/jarbundler.jar\"|g" \
        ${worksrcpath}/build.xml
    #Putting destination to destroot
    reinplace "s|<jarbundler dir=\"\${build.lib}\"|<jarbundler \
        dir=\"${destroot}${applications_dir}\"|g" ${worksrcpath}/build.xml
}

livecheck.type      sourceforge
livecheck.url       http://sourceforge.net/projects/jabref/files/jabref/
