source: trunk/dports/www/mod_jk2/Portfile @ 9794

Last change on this file since 9794 was 9794, checked in by jberry, 13 years ago

Revise description, and update homepage url

  • Property svn:eol-style set to native
File size: 4.4 KB
Line 
1# $Id: Portfile,v 1.5 2004/12/16 03:33:09 jberry Exp $
2
3PortSystem 1.0
4
5name                            mod_jk2
6version                         5.5.4
7
8categories                      www java
9maintainers                     jberry@opendarwin.org
10platforms                       darwin
11
12description                     Apache mod_jk2 remote server connector (from Tomcat).
13long_description        mod_jk2 provides a connection between apache2 and a remote \
14                                        server. It passes incoming requests on to the remote server \
15                                        for handling. Configurations may be mixed such that each \
16                                        server handles a particular type of request. mod_jk2 comes \
17                                        from the Java based Tomcat server, and is usually used with it. \
18                                        As of Nov, 2004, mod_jk2 has been officially 'unsupported' by apache. \
19                                        mod_jk, which jk2 once superceeded, has once again become the golden \
20                                        child. Please refer to the mod_jk port, and to apache2.1, where a new \
21                                        core module, proxy_ajp, replaces mod_jk2.
22homepage                        http://jakarta.apache.org/tomcat/connectors-doc/
23
24distname                        jakarta-tomcat-${version}-src
25master_sites            apache:jakarta/tomcat-5/v${version}/src/
26checksums                       md5 2fdfb34df8f670af2669d02fb6103a45
27
28patchfiles                      patch-workers2.properties.minimal.diff
29
30depends_build           path:${prefix}/apache2/bin/httpd:apache2
31depends_lib                     lib:pcre:pcre
32
33worksrcdir                      ${distname}/jakarta-tomcat-connectors/jk/native2
34
35
36# Try to determine a reasonable JAVA_HOME value
37if { [llength [array get env "JAVA_HOME"]] > 0 } {
38        set javahome $env(JAVA_HOME)
39} else {
40        set javahome ""
41}
42if { ![file isdirectory ${javahome}] } {
43        if { [variant_isset darwin] } {
44                if { [file isdirectory "/Library/Java/Home"] } {
45                        set javahome "/Library/Java/Home"
46                }
47        }
48}
49if { ![file isdirectory ${javahome}] } {
50        error "This port needs a reasonable value for JAVA_HOME, but couldn't automatically determine one: please set the environment variable."
51}
52
53
54post-patch {
55        # Clean up the the buildconf script
56        reinplace s|libtoolize|glibtoolize| ${worksrcpath}/buildconf.sh
57
58        # Fix link
59        reinplace s|-lcrypt|| ${worksrcpath}/server/apache2/Makefile.in
60}
61
62pre-configure {
63        # Check to be sure the apache2 port has been updated, and
64        # warn the user if it hasn't been.
65        # In port versions prior to 2.0.52_1, apxs didn't know where libdir was.
66        # That information is needed by the jk2 configure script.
67        set apxs ${prefix}/apache2/bin/apxs
68        if { [file executable ${apxs}] } {
69                set libdir [exec ${apxs} -q LIBDIR]
70                if { 0 == [string length ${libdir}] || ![file isdirectory ${libdir}] } {
71                        error "Your apache2 installation doesn't know where its library directory is. Please update your apache2 port."
72                }
73        }
74       
75        # Build the jk2 configure file
76        file attributes ${worksrcpath}/buildconf.sh -permissions ug+x
77        system "cd ${worksrcpath} && ./buildconf.sh"   
78}
79
80configure.args          --with-pcre \
81                                        --with-apxs2=${prefix}/apache2/bin/apxs \
82                                        --with-jni \
83                                        --with-java-home=${javahome}
84
85destroot {
86        # Install the jk2 connector for apache2
87        xinstall -m 755 -d \
88                ${destroot}${prefix}/apache2/modules \
89                ${destroot}${prefix}/apache2/conf
90               
91        xinstall -m 644 \
92                ${worksrcpath}/../build/jk2/apache2/mod_jk2.so \
93                ${worksrcpath}/../build/jk2/apache2/libjkjni.so \
94                ${destroot}${prefix}/apache2/modules
95               
96        xinstall -m 644 ${worksrcpath}/../conf/workers2.properties.minimal \
97                ${destroot}${prefix}/apache2/conf/workers2.properties.sample
98}
99
100
101post-install {
102        ui_msg "#"
103        ui_msg "# Example file ${prefix}/apache2/conf/workers2.properties.sample has"
104        ui_msg "# been installed to illustrate use of the jk2 connector between "
105        ui_msg "# apache2 and tomcat over a unix domain socket."
106        ui_msg "#"
107        ui_msg "# You will want to create a working copy of this file as workers2.properties"
108        ui_msg "# and configure the uri mappings within it, or using JkUriSet in httpd.conf."
109        ui_msg "#"
110        ui_msg "# If you're using Tomcat, note that you also need to configure the file"
111        ui_msg "# jk2.properties in tomcat5/conf (Tomcat should have installed a copy of this"
112        ui_msg "# file as jk2.properties.sample), or add appropriate attributes to the Connector"
113        ui_msg "# element in server.xml. Note that if you are going to use jk2.properties, you"
114        ui_msg "# now need to specify this in the Connector element in server.xml:"
115        ui_msg "#"
116        ui_msg "#       <Connector protocol='AJP/1.3' port='8009'"
117    ui_msg "#                  enableLookups='false' redirectPort='8443'"
118    ui_msg "#                  propertiesFile='conf/jk2.properties'"
119    ui_msg "#                  />"
120        ui_msg "#"
121        ui_msg "# Be sure to also add the following line to your httpd.conf:"
122        ui_msg "#"
123        ui_msg "#     LoadModule jk2_module modules/mod_jk2.so"
124        ui_msg "#"
125}
Note: See TracBrowser for help on using the repository browser.