# $Id: Portfile 90162 2012-02-24 16:44:32Z singingwolfboy@macports.org $

PortSystem 1.0

name                apache-ivy
version             2.2.0
revision            2
categories          devel java
maintainers         singingwolfboy openmaintainer
description         Dependency manager for Apache Ant
long_description    \
    Apache Ivy is a transitive dependency manager that is designed to \
    integrate with Apache Ant. An external XML file defines project \
    dependencies and lists the resources necessary to build a project. \
    Ivy then resolves and downloads resources from an artifact repository: \
    either a private repository or one publicly available on the Internet.
    
homepage            http://ant.apache.org/ivy/

platforms           darwin freebsd

distname            ${name}-${version}-src
master_sites        apache:ant/ivy/
master_sites.mirror_subdir  ${version}
worksrcdir          ${name}-${version}

depends_build       port:apache-ant

checksums           md5     9dab58aee2777bd72e3cff2f3ff9a119 \
                    sha1    5bed97ead53483a3db2d5a1b80b3f82516e148b7 \
                    rmd160  5ac59ceea455fdb45ab4514eae7ba378b5068a23

patchfiles          ivy-home.patch

use_configure       no                    
build.cmd           ant
build.target        /localivy jar

destroot {
    set javadir ${destroot}${prefix}/share/java/
    set docdir ${destroot}${prefix}/share/doc/
    xinstall -d ${javadir}/apache-ant/lib/ ${docdir}
    
    xinstall ${worksrcpath}/build/artifact/jars/ivy.jar ${javadir}
    ln -s ${prefix}/share/java/ivy.jar ${javadir}/apache-ant/lib/ivy.jar
    file delete -force ${worksrcpath}/build/artifact
    move ${worksrcpath}/doc ${docdir}/${name}
    # move ${worksrcpath} ${javadir}/${name}
}

platform darwin {
    extract.post_args   | gnutar -x
    build.env       JAVA_HOME=/Library/Java/Home
}

