Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  1 Jan 2006 22:30:35 +0000 (GMT)
From:      Dominic Mitchell <dom@happygiraffe.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        hollywar@holywar.net
Subject:   ports/91190: Update www/mod_fastcgi to work with Apache 2.2
Message-ID:  <20060101223035.1BA5BB851@happygiraffe.net>
Resent-Message-ID: <200601012240.k01Me3H7096796@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         91190
>Category:       ports
>Synopsis:       Update www/mod_fastcgi to work with Apache 2.2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 01 22:40:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Dominic Mitchell
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD ppe.happygiraffe.net 6.0-STABLE FreeBSD 6.0-STABLE #9: Sun Dec 25 17:51:37 GMT 2005 root@ppe.happygiraffe.net:/usr/obj/usr/src/sys/PPE i386

        Apache 2.2

>Description:

        Presently, mod_fastcgi doesn't compile with Apache 2.2.  I've
        tracked down a patch which makes it work correctly, and inserted
        it into this port.

        http://fastcgi.com/archives/fastcgi-developers/2005-December/004060.html

        In the process, I have converted the port to use the new
        USE_APACHE knob, simplifying the Makefile enormously.

>How-To-Repeat:

        n/a

>Fix:

        Here's the patch.  I've added one new file, files/patch-apache22
        and I've removed pkg-plist (it's no longer required).

diff -burN /usr/ports/www/mod_fastcgi/Makefile mod_fastcgi/Makefile
--- /usr/ports/www/mod_fastcgi/Makefile	Sun Oct  2 09:07:32 2005
+++ mod_fastcgi/Makefile	Sun Jan  1 22:29:54 2006
@@ -14,63 +14,19 @@
 MAINTAINER=	hollywar@mail.holywar.net
 COMMENT=	A fast-cgi module for Apache
 
-BUILD_DEPENDS=	${APXS}:${PORTSDIR}/${APACHE_PORT}
-
 CONFLICTS=	apache-contrib-1.*
-APACHE_COMPAT=	YES
-
-.include <bsd.port.pre.mk>
-
-.if defined(WITH_APACHE2) || exists(${LOCALBASE}/include/apache2/apr.h)
-WITH_APACHE2=	YES
-MAKEFILE=	Makefile.AP2
-USE_REINPLACE=	YES
-MAKE_ARGS=	INCLUDES=-I${PREFIX}/include/apache2
-INSTALL_TARGET=	install-modules
-PLIST_SUB=	APACHE=2
-.else
-PLIST_SUB=	APACHE=
-.endif
-
-.if defined(WITHOUT_APACHE_SUEXEC)
-APXSOPTS+=	-DNO_SUEXEC_FOR_AP_USER_N_GROUP
-.endif
-
-do-patch:
-.if defined(WITH_APACHE2)
-	@${REINPLACE_CMD} -e "s|/usr/local/apache2|${PREFIX}/share/apache2|g" ${WRKSRC}/${MAKEFILE}
-.else
-	cd ${WRKSRC} ; ${MV} Makefile.tmpl Makefile ;
-
-do-build:
-	cd ${WRKSRC} ; ${LOCALBASE}/sbin/apxs -o mod_fastcgi.so -c ${APXSOPT} *.c
-
-do-install:
-	cd ${WRKSRC} ; ${LOCALBASE}/sbin/apxs -i -a -n fastcgi mod_fastcgi.so
-.endif
+USE_APACHE=	1.3+
+AP_FAST_BUILD=	yes
+AP_GENPLIST=	yes
+SRC_FILE=	*.c
+PORTDOCS=	LICENSE.TERMS mod_fastcgi.html
 
 post-install:
 .if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-.for file in LICENSE.TERMS mod_fastcgi.html
-	${INSTALL_DATA} ${WRKSRC}/docs/${file} ${DOCSDIR}
+	${MKDIR} ${DOCSDIR}
+.for f in ${PORTDOCS}
+	${INSTALL_DATA} ${WRKSRC}/docs/${f} ${DOCSDIR}
 .endfor
 .endif
 
-	@${ECHO_MSG} "************************************************************"
-.if !defined(WITH_APACHE2)
-	@${ECHO_MSG} "* Fast-cgi modules was included with your apache           *"
-	@${ECHO_MSG} "* configuration file                                       *"
-	@${ECHO_MSG} "*                                                          *"
-.endif
-	@${ECHO_MSG} "* You need to add following lines to your apache           *"
-	@${ECHO_MSG} "* configuration file. and restart it !                     *"
-	@${ECHO_MSG} "*                                                          *"
-.if defined(WITH_APACHE2)
-	@${ECHO_MSG} "* LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so *"
-.endif
-	@${ECHO_MSG} "* AddHandler fastcgi-script fcgi fcgi fpl                  *"
-	@${ECHO_MSG} "*                                                          *"
-	@${ECHO_MSG} "************************************************************"
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -burN /usr/ports/www/mod_fastcgi/files/patch-apache22 mod_fastcgi/files/patch-apache22
--- /usr/ports/www/mod_fastcgi/files/patch-apache22	Thu Jan  1 01:00:00 1970
+++ mod_fastcgi/files/patch-apache22	Sun Jan  1 22:22:35 2006
@@ -0,0 +1,43 @@
+Originally from
+http://fastcgi.com/archives/fastcgi-developers/2005-December/004060.html
+
+diff -ruN mod_fastcgi-2.4.2/fcgi.h mod_fastcgi-2.4.2-ap22/fcgi.h
+--- fcgi.h    2003-02-04 00:07:37.000000000 +0100
++++ fcgi.h       2005-12-07 21:05:55.000000000 +0100
+@@ -73,6 +73,36 @@
+ #define ap_reset_timeout(a)
+ #define ap_unblock_alarms()
+
++/* starting with apache 2.2 the backward-compatibility defines for
++ * 1.3 APIs are not available anymore. Define them ourselves here.
++ */
++#ifndef ap_copy_table
++
++#define ap_copy_table apr_table_copy
++#define ap_cpystrn apr_cpystrn
++#define ap_destroy_pool apr_pool_destroy
++#define ap_isspace apr_isspace
++#define ap_make_array apr_array_make
++#define ap_make_table apr_table_make
++#define ap_null_cleanup apr_pool_cleanup_null
++#define ap_palloc apr_palloc
++#define ap_pcalloc apr_pcalloc
++#define ap_psprintf apr_psprintf
++#define ap_pstrcat apr_pstrcat
++#define ap_pstrdup apr_pstrdup
++#define ap_pstrndup apr_pstrndup
++#define ap_push_array apr_array_push
++#define ap_register_cleanup apr_pool_cleanup_register
++#define ap_snprintf apr_snprintf
++#define ap_table_add apr_table_add
++#define ap_table_do apr_table_do
++#define ap_table_get apr_table_get
++#define ap_table_set apr_table_set
++#define ap_table_setn apr_table_setn
++#define ap_table_unset apr_table_unset
++
++#endif /* defined(ap_copy_table) */
++
+ #if (defined(HAVE_WRITEV) && !HAVE_WRITEV && !defined(NO_WRITEV)) || defined WIN32
+ #define NO_WRITEV
+ #endif
diff -burN /usr/ports/www/mod_fastcgi/pkg-plist mod_fastcgi/pkg-plist
--- /usr/ports/www/mod_fastcgi/pkg-plist	Thu Jun 19 16:41:36 2003
+++ mod_fastcgi/pkg-plist	Thu Jan  1 01:00:00 1970
@@ -1,4 +0,0 @@
-libexec/apache%%APACHE%%/mod_fastcgi.so
-%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TERMS
-%%PORTDOCS%%%%DOCSDIR%%/mod_fastcgi.html
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060101223035.1BA5BB851>