source: trunk/dports/www/mod_jk/Portfile @ 87969

Last change on this file since 87969 was 76628, checked in by jmr@…, 9 years ago

mod_jk, mod_jk2: don't prevent the portfile from being opened at all when a JAVA_HOME can't be found

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.1 KB
Line 
1# $Id: Portfile 76628 2011-03-03 05:25:16Z jmr@macports.org $
2
3PortSystem 1.0
4
5name                            mod_jk
6version                         1.2.27
7
8categories                      www java
9maintainers                     jberry openmaintainer
10platforms                       darwin
11
12description                     Apache mod_jk remote server connector
13long_description        mod_jk is the connector supported by apache for communication between \
14                                        the apache server and tomcat. mod_jk2, which had for some time superceeded mod_jk, \
15                                        has now become officially 'unsupported' by the Apache group. \
16                                        mod_jk allows apache to be used refer some request for processing by tomcat or any \
17                                        other server that also supports the ajp13 protocol. \
18                                        Apache 2.1 will contain a replacement for mod_jk(2) called mod_proxy_ajp. \
19                                        At this time (this) mod_jk port supports only apache2, not apache 1.x.
20homepage                        http://tomcat.apache.org/connectors-doc/
21
22distname                        tomcat-connectors-${version}-src
23master_sites            http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/source/jk-${version}
24
25checksums           md5     a15cc9e3813ef5b081c7de10e6a1fbed \
26                    sha1    361f8aaa1844ac76a5dda741152968190b34347b \
27                    rmd160  cb872030d4325ba15d0038c6c7b298213768300a
28
29depends_build           path:apache2/bin/httpd:apache2
30worksrcdir                      ${distname}/native
31
32
33configure.args          --with-apxs=${prefix}/apache2/bin/apxs
34
35set apachedir       apache2
36
37# Determine a valid value for javahome
38if { [llength [array get env "JAVA_HOME"]] > 0 } {
39        set javahome $env(JAVA_HOME)
40} else {
41        set javahome ""
42}
43if { ![file isdirectory ${javahome}] } {
44        if { ${os.platform} == "darwin" } {
45                if { [file isdirectory "/System/Library/Frameworks/JavaVM.framework/Home"] } {
46                        set javahome "/System/Library/Frameworks/JavaVM.framework/Home"
47                }
48        }
49}
50if { ![file isdirectory ${javahome}] } {
51    pre-fetch {
52            error "This port needs a reasonable value for JAVA_HOME, but couldn't automatically determine one: please set the environment variable."
53    }
54}
55
56variant jni description {Build jni_connect.so and enable jni_worker} {
57        configure.args-append --with-java-home=${javahome} --enable-jni
58}
59
60pre-configure {
61        # Check to be sure the apache2 port has been updated, and
62        # warn the user if it hasn't been.
63        # In port versions prior to 2.0.52_1, apxs didn't know where libdir was.
64        # That information is needed by the jk configure script.
65        set apxs ${prefix}/${apachedir}/bin/apxs
66        if { [file executable ${apxs}] } {
67                set libdir [exec ${apxs} -q LIBDIR]
68                if { 0 == [string length ${libdir}] || ![file isdirectory ${libdir}] } {
69                        error "Your apache2 installation doesn't know where its library directory is. Please update your apache2 port."
70                }
71        }
72}
73
74destroot {
75        # Install the connector for apache2
76        xinstall -m 755 -d \
77                ${destroot}${prefix}/${apachedir}/modules \
78                ${destroot}${prefix}/${apachedir}/conf
79               
80        xinstall -m 644 \
81                ${worksrcpath}/apache-2.0/mod_jk.so \
82                ${destroot}${prefix}/${apachedir}/modules
83               
84        if {[variant_isset jni]} {
85                xinstall -m 644 \
86                        ${worksrcpath}/jni/jk_jnicb.so \
87                        ${destroot}${prefix}/${apachedir}/modules
88        }
89               
90        xinstall -m 644 ${worksrcpath}/../conf/workers.properties.minimal \
91                ${destroot}${prefix}/${apachedir}/conf/workers.properties.sample
92}
93
94
95post-install {
96        ui_msg "#"
97        ui_msg "# Example file ${prefix}/${apachedir}/conf/workers.properties.sample has"
98        ui_msg "# been installed to illustrate use of the jk connector between "
99        ui_msg "# apache2 and tomcat."
100        ui_msg "#"
101        ui_msg "# You will want to create a working copy of this file as workers.properties"
102        ui_msg "# and configure the uri mappings within it, or by using directives within httpd.conf."
103        ui_msg "#"
104        ui_msg "# Be sure to also add the following line to your httpd.conf:"
105        ui_msg "#"
106        ui_msg "#     LoadModule jk_module modules/mod_jk.so"
107        ui_msg "#"
108}
109
110variant apache20 description "install for apache 2.0.x" {
111    global apachedir
112    set apachedir apache20
113    depends_build-delete        path:apache2/bin/httpd:apache2
114    depends_build-append        path:apache20/bin/httpd:apache20
115    configure.args-delete       --with-apxs=${prefix}/apache2/bin/apxs
116    configure.args-append       --with-apxs=${prefix}/apache20/bin/apxs
117}
118
119livecheck.type  regex
120livecheck.regex "tomcat-connectors-(\\d+\\.\\d+(\\.\\d+)?)-src.tar.gz"
121
Note: See TracBrowser for help on using the repository browser.