# -*- 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 71878 2010-09-25 23:43:59Z ryandesign@macports.org $

PortSystem          1.0

name                xmlgraphics-commons
version             1.4
platforms           darwin
categories          java graphics
maintainers         nomaintainer
license             Apache-2.0
supported_archs     noarch

description         XML Graphics Commons

long_description    Apache XML Graphics Commons is a library that consists of \
                    several reusable components used by Apache Batik and \
                    Apache FOP. Many of these components can easily be used \
                    separately outside the domains of SVG and XSL-FO. You will \
                    find components such as a PDF library, an RTF library, \
                    Graphics2D implementations that let you generate PDF & \
                    PostScript files, and much more.

homepage            http://xmlgraphics.apache.org/commons
master_sites        apache:xmlgraphics/commons/source/

distname            ${name}-${version}-src
worksrcdir          ${name}-${version}

checksums           md5     d2b56a1671d2ca63480e38acd9629ea7 \
                    sha1    096a179035c0ee12b9570627caccfa181db55b58 \
                    rmd160  a690633f92abf34b314d339fa10ebf839af1cf4c

depends_build       bin:ant:apache-ant

depends_lib         port:junit \
                    port:commons-io \
                    port:commons-logging

patchfiles          patch-build.xml.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/build.xml
}

use_configure       no

build.cmd           ant
build.target        all

destroot {
    xinstall -m 755 -d \
        ${destroot}${prefix}/share/java \
        ${destroot}${prefix}/share/doc/${name}

    xinstall -m 644 \
        ${worksrcpath}/build/${name}-${version}.jar \
        ${destroot}${prefix}/share/java/

    xinstall -m 644 -W ${worksrcpath} \
        KEYS \
        LICENSE \
        NOTICE \
        README \
        ${destroot}${prefix}/share/doc/${name}
    
    ln -s ${name}-${version}.jar ${destroot}${prefix}/share/java/${name}.jar
}
