# $Id: Portfile 64734 2010-03-15 13:13:19Z nox@macports.org $

PortSystem 1.0

name				commons-daemon
version				1.0.2
license             Apache-2.0

categories			java
maintainers			jberry openmaintainer
platforms			darwin

description			Jakarta Commons-Daemon
long_description	An alternative invocation mechanism for unix-daemon-like \
					java code.
homepage			http://commons.apache.org/daemon/

distname			${name}-${version}-src
master_sites		apache:commons/daemon/source/

checksums           md5     a6c68eed204bc9f1ef3b77488edfcfeb \
                    sha1    a4e7e267c6accfeae5226f3a64ad2d7bd19993d1 \
                    rmd160  afad8e7608f342ea576efde374511e50d269ae84

patchfiles			patch-native-dso-dyld.c

depends_build		bin:ant:apache-ant
depends_lib			bin:java:kaffe \
					port:junit

configure.dir       ${worksrcpath}/src/native/unix

build.dir           ${configure.dir}
build.target        clean all

use_parallel_build  no

pre-build {
    system "cd ${worksrcpath} && \
        ant dist -Djunit.jar=${prefix}/share/java/junit.jar"
}

destroot {
    xinstall -d ${destroot}${prefix}/share/java \
        ${destroot}${prefix}/share/doc
    xinstall -m 644 ${worksrcpath}/dist/commons-daemon-${version}.jar \
        ${destroot}${prefix}/share/java/commons-daemon.jar
    xinstall ${worksrcpath}/src/native/unix/jsvc \
        ${destroot}${prefix}/bin
    set docdir ${prefix}/share/doc/${name}
    file copy ${worksrcpath}/dist/docs ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} LICENSE.txt NOTICE.txt PROPOSAL.html \
        RELEASE-NOTES.txt ${destroot}${docdir}
}

livecheck.type  regex
livecheck.url   http://commons.apache.org/downloads/download_daemon.cgi
livecheck.regex {>(\d+(?:\.\d+)*)\.tar}
