source: trunk/dports/java/commons-daemon/Portfile

Last change on this file was 96989, checked in by ciserlohn@…, 5 years ago

commons-daemon: pass JAVA_HOME to ant (fixes #35786 on Mountain Lion)

The JAVA_HOME environment variable set by the java port group get lost when ant
is carried out by the tcl system command. If JAVA_HOME is not set ant assumes
JAVA_HOME to be /System/Library/Frameworks/JavaVM.framework/Home. But newer JDKs
install in /Library/Java/JavaVirtualMachines and will cause ant to fail.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1# $Id: Portfile 96989 2012-08-23 20:25:50Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup  java 1.0
5
6name                            commons-daemon
7version                         1.0.10
8license             Apache-2
9
10categories                      java
11maintainers                     nomaintainer
12platforms                       darwin
13
14description                     Jakarta Commons-Daemon
15long_description        An alternative invocation mechanism for unix-daemon-like \
16                                        java code.
17homepage                        http://commons.apache.org/daemon/
18
19distname                        ${name}-${version}-src
20master_sites            apache:commons/daemon/source/
21
22checksums           rmd160  975d28ee016928842693e68d61e82cb5700975cf \
23                    sha256  2b60b28523cbd28497a02a298a341c51cabbe45983ec9e93616e6c91fbb5280c
24
25patchfiles                      patch-native-dso-dyld.c \
26                                        patch-configure.diff
27
28depends_build           bin:ant:apache-ant
29depends_lib                     bin:java:kaffe \
30                                        port:junit
31
32configure.dir       ${worksrcpath}/src/native/unix
33
34platform macosx {
35    pre-configure {
36        if {![file isfile "/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"]} {
37            ui_error "${name} requires the Java for Mac OS X development headers."
38            if {${os.major} == 10} {
39                ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719>"
40            } elseif {${os.major} == 9} {
41                ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20720>"
42            } else {
43                ui_error "Make sure your Xcode installation is complete."
44            }
45            return -code error "missing Java headers"
46        }
47    }
48}
49
50build.dir           ${configure.dir}
51build.target        clean all
52
53use_parallel_build  no
54
55pre-build {
56    system -W ${worksrcpath} "JAVA_HOME=${java_home} ant dist -Djunit.jar=${prefix}/share/java/junit.jar"
57}
58
59destroot {
60    xinstall -d ${destroot}${prefix}/share/java \
61        ${destroot}${prefix}/share/doc
62    xinstall -m 644 ${worksrcpath}/dist/commons-daemon-${version}.jar \
63        ${destroot}${prefix}/share/java/commons-daemon.jar
64    xinstall ${worksrcpath}/src/native/unix/jsvc \
65        ${destroot}${prefix}/bin
66    set docdir ${prefix}/share/doc/${name}
67    file copy ${worksrcpath}/dist/docs ${destroot}${docdir}
68    xinstall -m 644 -W ${worksrcpath} LICENSE.txt NOTICE.txt PROPOSAL.html \
69        RELEASE-NOTES.txt ${destroot}${docdir}
70}
71
72livecheck.type  regex
73livecheck.url   http://commons.apache.org/downloads/download_daemon.cgi
74livecheck.regex {>(\d+(?:\.\d+)*)\.tar}
Note: See TracBrowser for help on using the repository browser.