--- /opt/local/var/macports/sources/rsync.macports.org/release/ports/www/mod_jk2/Portfile	2008-11-11 08:41:44.000000000 +0900
+++ mod_jk2/Portfile	2009-12-08 17:26:36.000000000 +0900
@@ -3,14 +3,14 @@
 PortSystem 1.0
 
 name				mod_jk2
-version				5.5.4
+version				2.0.4
 
 categories			www java
 maintainers			nomaintainer
 platforms			darwin
 
 description			Apache mod_jk2 remote server connector (from Tomcat).
-long_description	mod_jk2 provides a connection between apache2 and a remote \
+long_description	mod_jk2 provides a connection between apache20 and a remote \
 					server. It passes incoming requests on to the remote server \
  					for handling. Configurations may be mixed such that each \
 					server handles a particular type of request. mod_jk2 comes \
@@ -21,16 +21,18 @@
 					core module, proxy_ajp, replaces mod_jk2.
 homepage			http://jakarta.apache.org/tomcat/connectors-doc/
 
-distname			jakarta-tomcat-${version}-src
-master_sites		apache:jakarta/tomcat-5/v${version}/src/
-checksums			md5 2fdfb34df8f670af2669d02fb6103a45
+distname			jakarta-tomcat-connectors-jk2-${version}-src
+master_sites		apache:tomcat/tomcat-connectors/jk2/source/
+checksums           md5     444bef31619f772df1f0b1c50e6ba773 \
+                    sha1    b81b262f1086e324216684b05753d562d7182e2c \
+                    rmd160  d02eaab9b50f816884850ccb6f41d9204927cad5
 
-patchfiles			patch-workers2.properties.minimal.diff
 
-depends_build		path:apache2/bin/httpd:apache2
+depends_build		path:apache20/bin/httpd:apache20
 depends_lib			lib:pcre:pcre
 
-worksrcdir			${distname}/jakarta-tomcat-connectors/jk/native2
+worksrcdir			${distname}/jk/native2
+
 
 
 # Try to determine a reasonable JAVA_HOME value
@@ -56,19 +58,20 @@
 	reinplace s|libtoolize|glibtoolize| ${worksrcpath}/buildconf.sh
 
 	# Fix link
-	reinplace s|-lcrypt|| ${worksrcpath}/server/apache2/Makefile.in
+ 	reinplace s|-lcrypt|| ${worksrcpath}/server/apache2/Makefile.in
 }
 
 pre-configure {
-	# Check to be sure the apache2 port has been updated, and
+	# Check to be sure the apache20 port has been updated, and
 	# warn the user if it hasn't been.
 	# In port versions prior to 2.0.52_1, apxs didn't know where libdir was.
 	# That information is needed by the jk2 configure script.
-	set apxs ${prefix}/apache2/bin/apxs
+	system "test -h ${prefix}/lib/libapr-0.so || ln -s libapr-0.dylib ${prefix}/lib/libapr-0.so"
+	set apxs ${prefix}/apache20/bin/apxs
 	if { [file executable ${apxs}] } {
 		set libdir [exec ${apxs} -q LIBDIR]
 		if { 0 == [string length ${libdir}] || ![file isdirectory ${libdir}] } {
-			error "Your apache2 installation doesn't know where its library directory is. Please update your apache2 port."
+			error "Your apache20 installation doesn't know where its library directory is. Please update your apache20 port."
 		}
 	}
 	
@@ -78,31 +81,36 @@
 }
 
 configure.args		--with-pcre \
-					--with-apxs2=${prefix}/apache2/bin/apxs \
-					--with-jni \
-					--with-java-home=${javahome}
+			--with-apache2=${prefix}/apache20 \
+			--with-apxs2=${prefix}/apache20/bin/apxs \
+			--with-apr-lib=${prefix}/lib \
+			--with-apr-include=${prefix}/include/apr-0 \
+#			--with-apr-util=${prefix}/lib/apr-util-1 \
+			--with-jni \
+			--with-java-home=${javahome}
+
+#				--with-apr=${prefix} \
 
 destroot {
-	# Install the jk2 connector for apache2
+	# Install the jk2 connector for apache20
 	xinstall -m 755 -d \
-		${destroot}${prefix}/apache2/modules \
-		${destroot}${prefix}/apache2/conf
+		${destroot}${prefix}/apache20/modules \
+		${destroot}${prefix}/apache20/conf
 		
 	xinstall -m 644 \
 		${worksrcpath}/../build/jk2/apache2/mod_jk2.so \
-		${worksrcpath}/../build/jk2/apache2/libjkjni.so \
-		${destroot}${prefix}/apache2/modules
+		${destroot}${prefix}/apache20/modules
 		
 	xinstall -m 644 ${worksrcpath}/../conf/workers2.properties.minimal \
-		${destroot}${prefix}/apache2/conf/workers2.properties.sample
+		${destroot}${prefix}/apache20/conf/workers2.properties.sample
 }
 
 
 post-install {
 	ui_msg "#"
-	ui_msg "# Example file ${prefix}/apache2/conf/workers2.properties.sample has"
+	ui_msg "# Example file ${prefix}/apache20/conf/workers2.properties.sample has"
 	ui_msg "# been installed to illustrate use of the jk2 connector between "
-	ui_msg "# apache2 and tomcat over a unix domain socket."
+	ui_msg "# apache20 and tomcat over a unix domain socket."
 	ui_msg "#"
 	ui_msg "# You will want to create a working copy of this file as workers2.properties"
 	ui_msg "# and configure the uri mappings within it, or using JkUriSet in httpd.conf."
