On Mon, Sep 10, 2007 at 11:59:27PM -0400, Mike Erdely wrote:
> On Sun, Sep 09, 2007 at 12:57:30PM -0700, Roland Philippsen wrote:
> > here's a suggestion for adding an Apache2-flavor to www/mod_fastcgi.
> > The patch (created with git) is best applied using 'patch -p2' from
> > within the mod_fastcgi directory. The unflavored build is identical to
> > what's in CVS right now, specifying FLAVOR=ap2 builds it for
> > www/apache-httpd.
> > 
> > Tested on a -current amd64 (as of yesterday).
> > 
> > Any comments welcome, of course. I tried to infer the appropriate
> > style from the docs and by looking at other ports, but this is my
> > first attempt so please don't get too upset if I blundered somewhere :o)
> 
> I tested this on macppc and i386.  Works as expected.
> 
> I made a couple tweaks and used "cvs diff" (below).
>  - I removed your "flavored_" PKGNAME prefix.
>  - I added "@comment share/.../mod_fastcgi.html.orig" to PFRAG.ap2 so
>    update-plist doesn't change any files.
> 

Another proposal using MULTI_PACKAGES instead of FLAVOR which allows to
install both at the same time.
patches/patch-fcgi_h works in both version, so i changed it to apply
unconditionally which make the Makefile even smaller.

Regards,
Simon
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    12 Sep 2007 22:50:58 -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,35 @@ 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
+
+post-patch:
+       mkdir ${WRKBUILD}/ap2 && touch ${WRKBUILD}/ap2/.deps
+       cd ${WRKBUILD}/ap2 && ln ../{Makefile.*,*.[hc],modules.mk} .
+
 do-build:
        (cd ${WRKBUILD}; apxs -o mod_fastcgi.so -c *.c)
+       (cd ${WRKBUILD}/ap2; ${GMAKE} -f Makefile.AP2 ${MAKE_FLAGS})
 
 post-build:
        @${MODAPACHE_CREATE_ENABLE_SCRIPT}
 
 do-install:
+       cd ${WRKBUILD}/ap2 && ${GMAKE} -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/patch-fcgi_h
===================================================================
RCS file: patches/patch-fcgi_h
diff -N patches/patch-fcgi_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-fcgi_h        12 Sep 2007 22:50:58 -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     12 Sep 2007 22:50:58 -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 12 Sep 2007 22:50:58 -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      12 Sep 2007 22:50:58 -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     12 Sep 2007 22:50:58 -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    12 Sep 2007 22:50:58 -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       12 Sep 2007 22:50:58 -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      12 Sep 2007 22:50:58 -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   12 Sep 2007 22:50:58 -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  12 Sep 2007 22:50:58 -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.

Reply via email to