ports/56661: modify port mod_jk2 to build mod_jk2 2.x

Palle Girgensohn girgen at pingpong.net
Wed Sep 10 01:10:18 UTC 2003


>Number:         56661
>Category:       ports
>Synopsis:       modify port mod_jk2 to build mod_jk2 2.x
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 09 18:10:15 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Palle Girgensohn <girgen at pingpong.net>
>Release:        FreeBSD 4-STABLE
>Organization:
PING PONG
>Environment:
System: FreeBSD palle.girgensohn.se 4.7-RC FreeBSD 4.7-RC #0: Sun Sep 29 17:21:22 CEST 2002     root at palle.girgensohn.se:/usr/local/obj/usr/src/sys/STORDATAN  i386


	
>Description:
This patch modifies the mod_jk2 port to build mod_jk2 instead of
mod_jk-1 for apache2.

This port actually produces (almost) the same thing as the just
comitted www/mod_jk-apache2. I think the name of this port is an
unlucky choice, since there exists such a thing as mod_jk2, which is
not really related to apache2. The maintainer/author of this port,
Larry Lansing, and myself have agreed on the following scheme:

mod_jk          - mod_jk 1.x for apache 1.3
mod_jk2         - mod_jk2 2.x for apache 1.3
mod_jk-apache2  - mod_jk 1.x for apache 2.x
mod_jk2-apache2 - mod_jk2 2.x for apache 2.x

since Larry's time is more limited than mine at the moment, I'll
temporarily take maintainership over these ports. He'll get it back
when things have settled down.

>How-To-Repeat:
	
>Fix:

cvs remove mod_jk2/files/mod_jk.conf.sample
cvs remove mod_jk2/files/workers.properties.sample

 and after patching per below,

cvs add mod_jk2/files/patch-common::jk_mutex_thread_c
cvs add mod_jk2/files/patch-include::jk_mutex_h
cvs add mod_jk2/files/patch-apache13-makefile-apxs-in

Then, perhaps, there should be an entry in MOVED, since mod_jk2
actually moved to mod_jk-apache2. I'm not sure about this, as I'm not
sure whether the header of the Makefile should be altered. This port
builds a different binary after this patch, the old version of the
port is moved... The comitter decides...


Index: mod_jk2/Makefile
===================================================================
RCS file: /home/ncvs/ports/www/mod_jk2/Makefile,v
retrieving revision 1.1
diff -u -u -r1.1 Makefile
--- mod_jk2/Makefile	6 Jun 2003 12:59:19 -0000	1.1
+++ mod_jk2/Makefile	10 Sep 2003 00:24:48 -0000
@@ -1,40 +1,69 @@
-# New ports collection makefile for:	mod_jk
-# Date created:				Thu Apr 10 15:14:37 EDT 2003
-# Whom:					Larry Lansing <lansil at fuzzynerd.com>
+# New ports collection makefile for:	mod_jk2
+# Date created:				Thu May 29 01:24:15 CEST 2003
+# Whom:					Palle Girgensohn <girgen at pingpong.net>
 #
-# $FreeBSD: ports/www/mod_jk2/Makefile,v 1.1 2003/06/06 12:59:19 edwin Exp $
+# $FreeBSD$
 #
 
-PORTNAME=	mod_jk
-PORTVERSION=	1.2.2
+PORTNAME=	mod_jk2
+PORTVERSION=	2.0.4
 CATEGORIES=	www
-MASTER_SITES=	${MASTER_SITE_APACHE_JAKARTA}
-MASTER_SITE_SUBDIR=	jakarta-tomcat-connectors/jk/release/v${PORTVERSION}/src
-PKGNAMESUFFIX=	-apache2
-DISTNAME=	jakarta-tomcat-connectors-jk-${PORTVERSION}-src
+MASTER_SITES=	${MASTER_SITE_APACHE_HTTPD:S/httpd/jakarta/}
+MASTER_SITE_SUBDIR=	tomcat-4/source
+DISTVERSION=	4.1.27
+DISTNAME=	jakarta-tomcat-connectors-${DISTVERSION}-src
+# The version numbers are a real mess, but hey, it's not my fault. The
+# distributions of tomcat are *really* messy.  The mod_jk2 is
+# distributed with tomcat-xxx, but does not share its version
+# numbering.  There is also a separate dist, but it seems to have been
+# left to die without further comments...
+
+MAINTAINER=	girgen at pingpong.net
+COMMENT=	Apache JK2 module for connecting to Tomcat using AJP1X
 
-MAINTAINER=	lansil at fuzzynerd.com
-COMMENT=	Apache 2.0 module for Tomcat
+.include <bsd.port.pre.mk>
+
+.if exists(${LOCALBASE}/include/apache2/apr.h)
+APACHE_PORT?=	${PORTSDIR}/www/apache2
+.else
+APACHE_PORT?=	${PORTSDIR}/www/apache13
+.endif
+
+.if ${APACHE_PORT:S/${PORTSDIR}\///} == "www/apache2"
+APACHE_VER=	2.0
+APACHE2=	2
+PLIST_SUB=	APACHE2=2
+PKGNAMESUFFIX=	-apache2
+.else
+APACHE_VER=	1.3
+APACHE2=
+PLIST_SUB=	APACHE2=
+.endif
 
 BUILD_DEPENDS=	${APXS}:${APACHE_PORT}
 RUN_DEPENDS=	${APXS}:${APACHE_PORT}
 
-APXS?=		${PREFIX}/sbin/apxs
-APACHE_PORT?=	${PORTSDIR}/www/apache2
-APACHE_CONF=	${PREFIX}/etc/apache2
-WRKSRC=		${WRKDIR}/jakarta-tomcat-connectors-jk-${PORTVERSION}-src/jk/native
+APXS=		${LOCALBASE}/sbin/apxs
+APACHE_CONF=	${LOCALBASE}/etc/apache${APACHE2}
+WRKSRC=		${WRKDIR}/jakarta-tomcat-connectors-${DISTVERSION}-src/jk/native2
 
 USE_GMAKE=	YES
 USE_LIBTOOL=	YES
-USE_AUTOCONF=	YES
-USE_AUTOMAKE=	YES
-HAS_CONFIGURE=	YES
-CONFIGURE_ARGS+=	--with-apxs=${APXS}
+USE_AUTOCONF_VER=	253
+USE_AUTOMAKE_VER=	15
+AUTOMAKE_ARGS=	--add-missing
+GNU_CONFIGURE=	YES
+CONFIGURE_ARGS+=	--with-apxs${APACHE2}=${APXS}
+ALL_TARGET=	jk2-build-apxs
+
+pre-patch:	build-depends
+
+post-patch:
+	cd ${WRKSRC}; ${ACLOCAL}; ${LIBTOOLIZE}
 
 do-install:
-	${APXS} -i -A -n jk ${WRKSRC}/apache-2.0/mod_jk.so
-	${SED} -e "s#%%APACHE_CONF%%#${APACHE_CONF}#g" ${FILESDIR}/mod_jk.conf.sample > ${WRKDIR}/mod_jk.conf.sample
-	${INSTALL_DATA} ${WRKDIR}/mod_jk.conf.sample ${APACHE_CONF}
-	${INSTALL_DATA} ${FILESDIR}/workers.properties.sample ${APACHE_CONF}
+	cd ${WRKSRC}/server/${APACHE_PORT:C/.*(apache[0-9]*).*/\1/} ;\
+		${GMAKE} -f Makefile.apxs install ;\
+		${APXS} -e -A -n jk2 mod_jk2.so
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: mod_jk2/distinfo
===================================================================
RCS file: /home/ncvs/ports/www/mod_jk2/distinfo,v
retrieving revision 1.1
diff -u -u -r1.1 distinfo
--- mod_jk2/distinfo	6 Jun 2003 12:59:19 -0000	1.1
+++ mod_jk2/distinfo	6 Sep 2003 21:56:35 -0000
@@ -1 +1 @@
-MD5 (jakarta-tomcat-connectors-jk-1.2.2-src.tar.gz) = 5e9e76f538d2dbd28d4e1d4f42145ab9
+MD5 (jakarta-tomcat-connectors-4.1.27-src.tar.gz) = 3dd9a39f008427dafe19be4a14464442
Index: mod_jk2/pkg-descr
===================================================================
RCS file: /home/ncvs/ports/www/mod_jk2/pkg-descr,v
retrieving revision 1.1
diff -u -u -r1.1 pkg-descr
--- mod_jk2/pkg-descr	6 Jun 2003 12:59:19 -0000	1.1
+++ mod_jk2/pkg-descr	8 Sep 2003 00:04:12 -0000
@@ -1,5 +1,4 @@
-mod_jk is a replacement to the elderly mod_jserv. It is a completely
-new Tomcat-Apache plugin that handles the communication between
-Tomcat and Apache.
+mod_jk2 handles the communication between Tomcat and Apache.
+JK2 is a refactoring of JK and is much more powerful.
 
 WWW: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/aphowto.html
Index: mod_jk2/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/www/mod_jk2/pkg-plist,v
retrieving revision 1.1
diff -u -u -r1.1 pkg-plist
--- mod_jk2/pkg-plist	6 Jun 2003 12:59:19 -0000	1.1
+++ mod_jk2/pkg-plist	7 Sep 2003 23:45:03 -0000
@@ -1,5 +1,3 @@
-etc/apache2/mod_jk.conf.sample
-etc/apache2/workers.properties.sample
-libexec/apache2/mod_jk.so
- at exec %D/sbin/apxs -e -A -n jk %f
- at unexec %D/sbin/apxs -e -A -n jk %f
+libexec/apache%%APACHE2%%/mod_jk2.so
+ at exec %D/sbin/apxs -e -A -n jk2 %f
+ at unexec %D/sbin/apxs -e -A -n jk2 %f
Index: mod_jk2/files/patch-configure.in
===================================================================
RCS file: /home/ncvs/ports/www/mod_jk2/files/patch-configure.in,v
retrieving revision 1.2
diff -u -u -r1.2 patch-configure.in
--- mod_jk2/files/patch-configure.in	4 Sep 2003 12:08:25 -0000	1.2
+++ mod_jk2/files/patch-configure.in	5 Sep 2003 11:56:03 -0000
@@ -1,12 +1,23 @@
---- configure.in.orig	Thu Sep  4 05:05:30 2003
-+++ configure.in	Thu Sep  4 05:06:25 2003
-@@ -102,7 +102,8 @@
-                 WEBSERVER="apache-2.0"
-               	APXSCFLAGS="`${APXS} -q CFLAGS` `${APXS} -q EXTRA_CFLAGS`"
-               	APXSCPPFLAGS="`${APXS} -q EXTRA_CPPFLAGS`"
--                APACHE_CONFIG_VARS=${apache_dir}/build/config_vars.mk
-+                APACHE_CONFIG_VARS=${prefix}/share/apache2/build/config_vars.mk
-+		LIBTOOL=`$APXS -q LIBTOOL`
-             fi
-             AC_MSG_RESULT([building connector for \"$WEBSERVER\"])
-     
+The apache mod_jk modules *communicate* with Java using an internet
+protocol, AJP13, but they are written in C.  I can't come up with any
+reason to look for a JDK here, it's plain stupid! Since apache and
+tomcat can be run on separate machines, there is no dependency
+whatsoever... /Palle
+
+--- configure.in~	Wed Mar 19 10:21:04 2003
++++ configure.in	Thu May 29 01:50:48 2003
+@@ -184,10 +184,10 @@
+ 
+ dnl Java settings
+ 
+-JK_JDK()
+-JK_JDK_OS()
+-JK_JNI()
+-JK_PCRE()
++dnl JK_JDK()
++dnl JK_JDK_OS()
++dnl JK_JNI()
++dnl JK_PCRE()
+ 
+ AC_SUBST(JAVA_HOME)
+ AC_SUBST(JAVA_PLATFORM)
--- /dev/null	Wed Sep 10 02:56:41 2003
+++ mod_jk2/files/patch-apache13-makefile-apxs-in	Fri Sep  5 13:56:03 2003
@@ -0,0 +1,14 @@
+--- server/apache13/Makefile.apxs.in.orig	Wed Mar 19 10:21:04 2003
++++ server/apache13/Makefile.apxs.in	Wed Jun 18 03:10:02 2003
+@@ -18,7 +18,10 @@
+ all: mod_jk2.so
+ 
+ mod_jk2.so: 
+-	$(APXS) -c -o $@ -Wc,"${JK_INCL} ${APR_CFLAGS} ${APR_LDFLAGS}" "${JAVA_INCL}" mod_jk2.c ${COMMON_C_FILES} 
++	$(APXS) -c -o $@ -Wc,"${JK_INCL} ${APR_CFLAGS} ${APR_LDFLAGS}" "${JAVA_INCL}" jk_service_apache13.c mod_jk2.c ${COMMON_C_FILES} 
++
++install:
++	$(APXS) -i mod_jk2.so
+ 
+ clean:
+ 	rm -f *.o *.so
--- /dev/null	Wed Sep 10 02:56:41 2003
+++ mod_jk2/files/patch-common::jk_mutex_thread_c	Wed Sep 10 01:41:04 2003
@@ -0,0 +1,11 @@
+--- common/jk_mutex_thread.c~	Thu Jul 31 19:30:38 2003
++++ common/jk_mutex_thread.c	Wed Sep 10 01:37:29 2003
+@@ -159,7 +159,7 @@
+ }
+ 
+ 
+-#elif defined( _REENTRANT )
++#elif defined( _THREAD_SAFE ) && defined( FREEBSD_THREAD_HACK )
+ /*-------------------- PThread - @deprecated, use APR if possible -------------------- */
+ 
+ #include <pthread.h>
--- /dev/null	Wed Sep 10 02:56:41 2003
+++ mod_jk2/files/patch-include::jk_mutex_h	Wed Sep 10 01:43:06 2003
@@ -0,0 +1,20 @@
+--- include/jk_mutex.h~	Thu Jul 31 19:30:40 2003
++++ include/jk_mutex.h	Wed Sep 10 01:33:27 2003
+@@ -76,7 +76,7 @@
+ #include "apr_thread_mutex.h"
+ #elif defined( WIN32 )
+ #include <windows.h>
+-#elif defined( _REENTRANT )
++#elif defined( _THREAD_SAFE ) && defined ( FREEBSD_THREAD_HACK )
+ #include <pthread.h>
+ #endif
+ 
+@@ -122,7 +122,7 @@
+     apr_thread_mutex_t *threadMutex;
+ #elif defined( WIN32 )
+     CRITICAL_SECTION threadMutex;
+-#elif defined( _REENTRANT )
++#elif defined( _THREAD_SAFE ) && defined ( FREEBSD_THREAD_HACK )
+     pthread_mutex_t threadMutex;
+ #else
+     void *threadMutex;
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list