On Thu, Sep 13, 2007 at 09:28:56AM +0200, Marc Balmer wrote:
> I don't use Apache 2. I just ask you guys to not change the default
> behaviour (for the in-tree Apache) and that a "final" diff has my ok on
> it.
I made some changes that fix what Roland mentioned earlier in the thread:
http://marc.info/?l=openbsd-ports&m=118965843013806&w=2
Changes:
- s/\${GMAKE}/${MAKE}/ (gmake is not needed)
- I moved Simon's post-patch section to pre-patch. This was the crux
of Roland's issue (I saw it too with Apache2) that chroot specific
patches were adding unnecessary symbols to the ap2 version.
- I added a post-patch which only patches the ap2 specific files, even
though the fcgi.h patch doesn't seem to affect the ap1 version, it's
not necessary.
I tested this on i386 and macppc. ap1 version works as it always did.
ap2 version works with no errors when starting apache2.
Thoughts? Comments? ok?
-ME
Index: Makefile
===================================================================
RCS file: /cvs/ports/www/mod_fastcgi/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile 30 Jun 2007 15:32:30 -0000 1.4
+++ Makefile 13 Sep 2007 16:07:44 -0000
@@ -1,9 +1,11 @@
# $OpenBSD: Makefile,v 1.4 2007/06/30 15:32:30 simon Exp $
-COMMENT= "Apache FastCGI module"
+COMMENT-main= Apache FastCGI module
+COMMENT-ap2= Apache2 FastCGI module
DISTNAME= mod_fastcgi-2.4.2
-PKGNAME= ${DISTNAME}p1
+PKGNAME-main= ${DISTNAME}p1
+PKGNAME-ap2= ap2-${DISTNAME}
CATEGORIES= www
@@ -24,13 +26,40 @@ PERMIT_DISTFILES_FTP= Yes
NO_REGRESS= Yes
+MULTI_PACKAGES= -main -ap2
+
+BUILD_DEPENDS= ::www/apache-httpd
+
+MAKE_FLAGS= top_dir=${PREFIX}/share/apache2 \
+ APXS=${PREFIX}/sbin/apxs2 \
+ APACHECTL=${PREFIX}/sbin/apachectl2
+
+FAKE_FLAGS= top_dir=${TRUEPREFIX}/share/apache2 \
+ APXS=${TRUEPREFIX}/sbin/apxs2 \
+ APACHECTL=${TRUEPREFIX}/sbin/apachectl2
+
+DESCR-ap2= ${PKGDIR}/DESCR-main
+
+pre-patch:
+ mkdir ${WRKBUILD}/ap2 && touch ${WRKBUILD}/ap2/.deps
+ cd ${WRKBUILD}/ap2 && ln ../{Makefile.*,*.[hc],modules.mk} .
+
+post-patch:
+ @cd ${WRKBUILD}/ap2 && \
+ ${PATCH} -z .orig --forward --quiet -E -p0 < \
+ ${PATCHDIR}/ap2-patch-fcgi_h
+
do-build:
(cd ${WRKBUILD}; apxs -o mod_fastcgi.so -c *.c)
+ (cd ${WRKBUILD}/ap2; ${MAKE} -f Makefile.AP2 ${MAKE_FLAGS})
post-build:
@${MODAPACHE_CREATE_ENABLE_SCRIPT}
do-install:
+ cd ${WRKBUILD}/ap2 && ${MAKE} -f Makefile.AP2 ${FAKE_FLAGS}
local-install
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/apache2/mod/mod_fastcgi
+ ${INSTALL_DATA} ${WRKBUILD}/docs/*
${PREFIX}/share/doc/apache2/mod/mod_fastcgi
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/mod_fastcgi
${INSTALL_DATA} ${WRKBUILD}/docs/* ${PREFIX}/share/doc/mod_fastcgi
${MODAPACHE_INSTALL}
Index: patches/ap2-patch-fcgi_h
===================================================================
RCS file: patches/ap2-patch-fcgi_h
diff -N patches/ap2-patch-fcgi_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/ap2-patch-fcgi_h 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,41 @@
+$OpenBSD$
+--- fcgi.h.orig Tue Feb 4 00:07:37 2003
++++ fcgi.h Thu Sep 13 00:01:59 2007
+@@ -73,6 +73,37 @@ typedef apr_status_t apcb_t;
+ #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.
++ * see
http://www.fastcgi.com/archives/fastcgi-developers/2005-December/004060.html
++ */
++#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
Index: patches/patch-fcgi_pm_c
===================================================================
RCS file: /cvs/ports/www/mod_fastcgi/patches/patch-fcgi_pm_c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-fcgi_pm_c
--- patches/patch-fcgi_pm_c 14 Feb 2005 06:23:23 -0000 1.1.1.1
+++ patches/patch-fcgi_pm_c 13 Sep 2007 16:07:44 -0000
@@ -1,6 +1,6 @@
--- fcgi_pm.c.orig Thu Oct 30 02:08:34 2003
-+++ fcgi_pm.c Mon Feb 14 06:57:49 2005
-@@ -26,7 +26,7 @@ time_t fcgi_dynamic_epoch = 0;
++++ fcgi_pm.c Wed Sep 12 23:32:02 2007
+@@ -26,7 +26,7 @@ time_t fcgi_dynamic_epoch = 0; /* last time
* invoked by process mgr */
time_t fcgi_dynamic_last_analyzed = 0; /* last time calculation was
* made for the dynamic procs */
@@ -9,7 +9,7 @@
static time_t now = 0;
#ifdef WIN32
-@@ -1092,6 +1092,8 @@ static void dynamic_read_msgs(int read_r
+@@ -1092,6 +1092,8 @@ static void dynamic_read_msgs(int read_ready)
/* Create socket file's path */
s->socket_path = fcgi_util_socket_hash_filename(tp, execName,
user, group);
s->socket_path = fcgi_util_socket_make_path_absolute(sp,
s->socket_path, 1);
Index: patches/patch-mod_fastcgi_c
===================================================================
RCS file: /cvs/ports/www/mod_fastcgi/patches/patch-mod_fastcgi_c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-mod_fastcgi_c
--- patches/patch-mod_fastcgi_c 14 Feb 2005 06:23:23 -0000 1.1.1.1
+++ patches/patch-mod_fastcgi_c 13 Sep 2007 16:07:44 -0000
@@ -1,6 +1,6 @@
--- mod_fastcgi.c.orig Thu Oct 30 02:08:34 2003
-+++ mod_fastcgi.c Mon Feb 14 06:54:32 2005
-@@ -1074,7 +1074,8 @@ static int open_connection_to_fs(fcgi_re
++++ mod_fastcgi.c Wed Sep 12 23:32:02 2007
+@@ -1074,7 +1074,8 @@ static int open_connection_to_fs(fcgi_request *fr)
{
socket_path = fcgi_util_socket_hash_filename(rp, fr->fs_path,
fr->user, fr->group);
socket_path = fcgi_util_socket_make_path_absolute(rp, socket_path, 1);
Index: pkg/DESCR
===================================================================
RCS file: pkg/DESCR
diff -N pkg/DESCR
--- pkg/DESCR 14 Feb 2005 06:23:23 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,9 +0,0 @@
-mod_fastcgi is a module for the Apache web server, that enables
-FastCGI - a standards based protocol for communicating with
-applications that generate dynamic content for web pages.
-
-FastCGI provides a superset of CGI functionality, but a subset of the
-functionality of programming for a particular web server API.
-Nonetheless, the feature set is rich enough for programming virtually
-any type of web application, but the result is generally more
-scalable.
Index: pkg/DESCR-main
===================================================================
RCS file: pkg/DESCR-main
diff -N pkg/DESCR-main
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-main 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,9 @@
+mod_fastcgi is a module for the Apache web server, that enables
+FastCGI - a standards based protocol for communicating with
+applications that generate dynamic content for web pages.
+
+FastCGI provides a superset of CGI functionality, but a subset of the
+functionality of programming for a particular web server API.
+Nonetheless, the feature set is rich enough for programming virtually
+any type of web application, but the result is generally more
+scalable.
Index: pkg/MESSAGE
===================================================================
RCS file: pkg/MESSAGE
diff -N pkg/MESSAGE
--- pkg/MESSAGE 22 Jun 2007 14:48:23 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,8 +0,0 @@
-To finish the install of mod_fastcgi, you need
-to enable the module using the following command
-
- ${PREFIX}/sbin/${MODAPACHE_ENABLE}
-
-If you already have Apache running on your machine,
-you should not use "apachectl restart" - instead,
-you should fully stop and then restart the server.
Index: pkg/MESSAGE-ap2
===================================================================
RCS file: pkg/MESSAGE-ap2
diff -N pkg/MESSAGE-ap2
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/MESSAGE-ap2 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,9 @@
+To finish the install of mod_fastcgi, you need
+to enable the module by adding the following line
+to your /etc/apache2/httpd2.conf file:
+
+ LoadModule fastcgi_module ${PREFIX}/lib/apache2/mod_fastcgi.so
+
+If you already have Apache running on your machine,
+you should not use "apachectl2 restart" - instead,
+you should fully stop and then restart the server.
Index: pkg/MESSAGE-main
===================================================================
RCS file: pkg/MESSAGE-main
diff -N pkg/MESSAGE-main
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/MESSAGE-main 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,8 @@
+To finish the install of mod_fastcgi, you need
+to enable the module using the following command
+
+ ${PREFIX}/sbin/${MODAPACHE_ENABLE}
+
+If you already have Apache running on your machine,
+you should not use "apachectl restart" - instead,
+you should fully stop and then restart the server.
Index: pkg/PLIST
===================================================================
RCS file: pkg/PLIST
diff -N pkg/PLIST
--- pkg/PLIST 22 Jun 2007 14:48:23 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,9 +0,0 @@
[EMAIL PROTECTED] $OpenBSD: PLIST,v 1.2 2007/06/22 14:48:23 simon Exp $
-lib/${MODAPACHE_MODULE}
[EMAIL PROTECTED] test -f ${MODAPACHE_FINAL} && cp -fp %D/%F ${MODAPACHE_FINAL}
-sbin/${MODAPACHE_ENABLE}
-share/doc/mod_fastcgi/
-share/doc/mod_fastcgi/LICENSE.TERMS
-share/doc/mod_fastcgi/mod_fastcgi.html
[EMAIL PROTECTED] rm -f ${MODAPACHE_FINAL}
[EMAIL PROTECTED] share/doc/mod_fastcgi/mod_fastcgi.html.orig
Index: pkg/PLIST-ap2
===================================================================
RCS file: pkg/PLIST-ap2
diff -N pkg/PLIST-ap2
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-ap2 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,9 @@
[EMAIL PROTECTED] $OpenBSD$
+lib/apache2/
+lib/apache2/${MODAPACHE_MODULE}
+share/doc/apache2/
+share/doc/apache2/mod/
+share/doc/apache2/mod/mod_fastcgi/
+share/doc/apache2/mod/mod_fastcgi/LICENSE.TERMS
+share/doc/apache2/mod/mod_fastcgi/mod_fastcgi.html
[EMAIL PROTECTED] share/doc/apache2/mod/mod_fastcgi/mod_fastcgi.html.orig
Index: pkg/PLIST-main
===================================================================
RCS file: pkg/PLIST-main
diff -N pkg/PLIST-main
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-main 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,9 @@
[EMAIL PROTECTED] $OpenBSD$
+lib/${MODAPACHE_MODULE}
[EMAIL PROTECTED] test -f ${MODAPACHE_FINAL} && cp -fp %D/%F ${MODAPACHE_FINAL}
+sbin/${MODAPACHE_ENABLE}
+share/doc/mod_fastcgi/
+share/doc/mod_fastcgi/LICENSE.TERMS
+share/doc/mod_fastcgi/mod_fastcgi.html
[EMAIL PROTECTED] rm -f ${MODAPACHE_FINAL}
[EMAIL PROTECTED] share/doc/mod_fastcgi/mod_fastcgi.html.orig
Index: pkg/UNMESSAGE
===================================================================
RCS file: pkg/UNMESSAGE
diff -N pkg/UNMESSAGE
--- pkg/UNMESSAGE 14 Feb 2005 06:23:23 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,8 +0,0 @@
-To completely deinstall the mod_fastcgi package you
-need to perform these steps as root:
-
- edit /var/www/conf/httpd.conf
- remove the line: LoadModule fastcgi_module
-
-Do not do this if you plan on re-installing the mod_fastcgi
-package at some future time.
Index: pkg/UNMESSAGE-ap2
===================================================================
RCS file: pkg/UNMESSAGE-ap2
diff -N pkg/UNMESSAGE-ap2
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/UNMESSAGE-ap2 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,8 @@
+To completely deinstall the mod_fastcgi package you
+need to perform these steps as root:
+
+ edit /etc/apache2/httpd2.conf
+ remove the line: LoadModule fastcgi_module
+
+Do not do this if you plan on re-installing the mod_fastcgi
+package at some future time.
Index: pkg/UNMESSAGE-main
===================================================================
RCS file: pkg/UNMESSAGE-main
diff -N pkg/UNMESSAGE-main
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/UNMESSAGE-main 13 Sep 2007 16:07:44 -0000
@@ -0,0 +1,8 @@
+To completely deinstall the mod_fastcgi package you
+need to perform these steps as root:
+
+ edit /var/www/conf/httpd.conf
+ remove the line: LoadModule fastcgi_module
+
+Do not do this if you plan on re-installing the mod_fastcgi
+package at some future time.