source: trunk/dports/www/mod_jk2/Portfile

Last change on this file was 114325, checked in by ryandesign@…, 4 years ago

use eq and ne instead of == and != when comparing ${os.platform} and ${os.subplatform}

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