ports/159535: [patch] add support for building www/websh with EAPI support

Mark Johnston markjdb at gmail.com
Fri Aug 5 21:30:11 UTC 2011


>Number:         159535
>Category:       ports
>Synopsis:       [patch] add support for building www/websh with EAPI support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 05 21:30:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Mark Johnston
>Release:        8.2
>Organization:
>Environment:
FreeBSD oddish.mark-home 8.2-STABLE FreeBSD 8.2-STABLE #0: Mon May 16 18:43:29 EDT 2011     root at oddish.mark-home:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
It's possible to build mod_websh for Apache 1.3; if Apache 1.3 is built with EAPI support (as is required for mod_ssl), all modules it uses must also be built with EAPI support in order to avoid the following warning:

[warn] Loaded DSO libexec/apache/mod_websh.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)

This PR adds a patch to add an option to compile with -DEAPI. It adds the option to the Makefile, and creates a patch to be applied to Makefile.in if the user chooses to enable EAPI support. I'm not sure if this is the best way to do things, I just copied what www/mod_python does for this. I think it would be easier to just write

.if defined(WITH_EAPI)
CFLAGS+=-DEAPI
.endif

but I couldn't find any examples of this. If this is the preferred way of adding the variable, let me know and I'll submit a revised patch.

The EAPI ports variable is intended to be used with Apache 1.3 only, but setting it with Apache 2 will have no effect since there are no "#ifdef EAPI"s in the Apache 2 headers or the websh code.
>How-To-Repeat:
Install Apache 1.3 with EAPI support (www/apache13-modssl will do it), install mod_websh and start Apache.
>Fix:
Recompile mod_websh.so with -DEAPI.

Patch attached with submission follows:

diff --git a/files/optpatch-EAPI b/files/optpatch-EAPI
new file mode 100644
index 0000000..a02d2eb
--- /dev/null
+++ b/files/optpatch-EAPI
@@ -0,0 +1,11 @@
+--- Makefile.in 2011-08-05 16:45:16.000000000 -0400
++++ Makefile.in	2011-08-05 16:45:34.000000000 -0400
+@@ -147,7 +147,7 @@ INCLUDES = @TCL_INCLUDES@ $(HTTPD_INCLUD
+
+ EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) \
+ 	$(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) \
+-	$(TCL_EXTRA_CFLAGS)
++	-DEAPI $(TCL_EXTRA_CFLAGS)
+ 
+ DEFS = -DVERSION=\"@VERSION@\" -D at PLATFORM@=1 -DUSE_TCL_STUBS=@USE_TCL_STUBS@ $(EXTRA_CFLAGS)
+ 
diff --git a/Makefile b/Makefile
index 0721003..2aa601d 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,8 @@ COMMENT=	Embeds a TCL8 interpreter in the Apache server
 
 MAKE_JOBS_UNSAFE=	yes
 
+OPTIONS=	EAPI "Build with Apache EAPI support (Apache 1.3 only)" off
+
 TCL_DVER=	${TCL_VER:S/.//}
 
 USE_TCL=	84+
@@ -40,6 +42,13 @@ CPPFLAGS+=	-I ${LOCALBASE}/include/apr-1
 CPPFLAGS+=	-Wall -Werror
 .endif
 
+.include <bsd.port.pre.mk>
+
+pre-patch:
+.if defined(WITH_EAPI)
+	cd ${WRKSRC} && ${PATCH} -s < ${PATCHDIR}/optpatch-WANT_EAPI
+.endif
+
 post-patch:
 	${REINPLACE_CMD} -e 's,/usr/local/websh,${PREFIX},' \
 		${WRKSRC:H:H}/doc/mod_websh/conf/websh.conf
@@ -85,8 +94,6 @@ post-install:
 	@${APXS} -e -a -n "${SHORTMODNAME}" "${APACHEMODDIR}/mod_${MODULENAME}.so"
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.pre.mk>
-
 CONFIGURE_ENV+=	CPPFLAGS="${CPPFLAGS}"
 
 .include <bsd.port.post.mk>


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list