From craig@yekse.gank.org  Thu Mar  2 20:24:47 2006
Return-Path: <craig@yekse.gank.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DC7EB16A420
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Mar 2006 20:24:46 +0000 (GMT)
	(envelope-from craig@yekse.gank.org)
Received: from ion.gank.org (ion.gank.org [64.81.113.130])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E934543D48
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Mar 2006 20:24:45 +0000 (GMT)
	(envelope-from craig@yekse.gank.org)
Received: by ion.gank.org (mail, from userid 1001)
	id 864EDCDA; Thu,  2 Mar 2006 14:24:43 -0600 (CST)
Message-Id: <20060302202443.864EDCDA@ion.gank.org>
Date: Thu,  2 Mar 2006 14:24:43 -0600 (CST)
From: Craig Boston <craig@yekse.gank.org>
Reply-To: Craig Boston <craig@yekse.gank.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: www/suphp doesn't work with Apache 2.2 (patch)
X-Send-Pr-Version: 3.113
X-GNATS-Notify: freebsd@jdc.parodius.com

>Number:         94034
>Category:       ports
>Synopsis:       www/suphp doesn't work with Apache 2.2 (patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 02 20:30:05 GMT 2006
>Closed-Date:    Sat Apr 08 12:56:34 GMT 2006
>Last-Modified:  Sat Apr 08 12:56:34 GMT 2006
>Originator:     Craig Boston
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
>Environment:
>Description:
	Attached patch enables suphp to compile against Apache 2.2.

	It also fixes the port not working when WRKDIRPREFIX is set.
>How-To-Repeat:
>Fix:

--- suphp.patch begins here ---
diff -ruN suphp.orig/Makefile suphp/Makefile
--- suphp.orig/Makefile	Thu Mar  2 13:23:34 2006
+++ suphp/Makefile	Thu Mar  2 13:50:15 2006
@@ -16,7 +16,7 @@
 
 GNU_CONFIGURE=	yes
 USE_PHP=	yes
-USE_APACHE=	yes
+USE_APACHE=	1.3+
 WANT_PHP_CGI=	yes
 CONFLICTS=	mod_php4-4* php-4.* mod_php5-5* php-5.*
 
@@ -53,18 +53,11 @@
 
 .include <bsd.port.pre.mk>
 
-.if exists(${LOCALBASE}/include/apache2/apr.h) || defined(WITH_APACHE2)
-APACHE_PORT=	www/apache20
-PLIST_SUB+=	MODULEDIR="libexec/apache2/"
-.else
-PLIST_SUB+=	MODULEDIR="libexec/apache/"
-.endif
-
 show-options:
 	@${SED} -ne 's/^##//p' ${.CURDIR}/Makefile
 
-pre-everything::
-	@${MAKE} show-options
+pre-everything:: show-options
+	@${DO_NADA}
 
 post-install:
 .if !defined(NOPORTDOCS)
diff -ruN suphp.orig/files/patch-configure suphp/files/patch-configure
--- suphp.orig/files/patch-configure	Wed Dec 31 18:00:00 1969
+++ suphp/files/patch-configure	Thu Mar  2 13:41:57 2006
@@ -0,0 +1,11 @@
+--- configure.orig	Thu Mar  2 13:38:36 2006
++++ configure	Thu Mar  2 13:39:23 2006
+@@ -2405,7 +2405,7 @@
+                     | cut -f2 -d"/" \
+                     | cut -f1 -d" "`
+     major_version=`echo $APACHE_VERSION|cut -f1,2 -d.`
+-    if test "$major_version" = "2.0"; then
++    if test "$major_version" = "2.0" -o "$major_version" = "2.2"; then
+       APACHE_VERSION_2=true
+       APACHE_VERSION_1_3=false
+     else
diff -ruN suphp.orig/files/patch-src::apache2::mod_suphp.c suphp/files/patch-src::apache2::mod_suphp.c
--- suphp.orig/files/patch-src::apache2::mod_suphp.c	Thu Mar  2 13:23:34 2006
+++ suphp/files/patch-src::apache2::mod_suphp.c	Thu Mar  2 13:47:56 2006
@@ -14,3 +14,36 @@
      
      /* set resource limits */
  
+@@ -524,7 +530,9 @@
+             return rv;
+         }
+         
+-        APR_BRIGADE_FOREACH(bucket, bb)
++ 	for (bucket = APR_BRIGADE_FIRST(bb);
++ 	     bucket != APR_BRIGADE_SENTINEL(bb);
++ 	     bucket = APR_BUCKET_NEXT(bucket))
+         {
+             const char *data;
+             apr_size_t len;
+@@ -595,7 +603,9 @@
+             
+             const char *buf;
+             apr_size_t blen;
+-            APR_BRIGADE_FOREACH(b, bb)
++ 	    for (b = APR_BRIGADE_FIRST(bb);
++ 		 b != APR_BRIGADE_SENTINEL(bb);
++ 		 b = APR_BUCKET_NEXT(b))
+             {
+                 if (APR_BUCKET_IS_EOS(b))
+                     break;
+@@ -616,7 +626,9 @@
+             /* empty brigade (script output) */
+             const char *buf;
+             apr_size_t blen;
+-            APR_BRIGADE_FOREACH(b, bb)
++ 	    for (b = APR_BRIGADE_FIRST(bb);
++ 		 b != APR_BRIGADE_SENTINEL(bb);
++ 		 b = APR_BUCKET_NEXT(b))
+             {
+                 if (APR_BUCKET_IS_EOS(b))
+                     break;
diff -ruN suphp.orig/pkg-plist suphp/pkg-plist
--- suphp.orig/pkg-plist	Thu Mar  2 13:23:34 2006
+++ suphp/pkg-plist	Thu Mar  2 13:26:50 2006
@@ -1,5 +1,5 @@
 sbin/suphp
-%%MODULEDIR%%/mod_suphp.so
+%%APACHEMODDIR%%/mod_suphp.so
 @exec %D/sbin/apxs -e -a -n suphp %D/%f
 @unexec %D/sbin/apxs -e -A -n suphp %D/%f
 %%PORTDOCS%%%%DOCSDIR%%/en/INSTALL
--- suphp.patch ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Mar 2 20:32:31 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94034 

From: Jeremy Chadwick <freebsd@jdc.parodius.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/94034: www/suphp doesn't work with Apache 2.2 (patch)
Date: Thu, 2 Mar 2006 20:01:34 -0800

 On Thu, Mar 02, 2006 at 08:32:15PM +0000, Edwin Groothuis wrote:
 > Maintainer of www/suphp,
 > 
 > Please note that PR ports/94034 has just been submitted.
 > 
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 > 
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/94034
 
 
 I approve of this update.  Please commit it at your leisure.
 
 -- 
 | Jeremy Chadwick                                 jdc at parodius.com |
 | Parodius Networking                        http://www.parodius.com/ |
 | UNIX Systems Administrator                   Mountain View, CA, USA |
 | Making life hard for others since 1977.                             |

From: Craig Boston <craig@yekse.gank.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/94034: www/suphp doesn't work with Apache 2.2 (patch)
Date: Sun, 5 Mar 2006 01:51:53 -0600

 --6TrnltStXW4iwmi0
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 It turns out there is another small issue with Apache 2.2 and suphp.  A
 revised version of patch-src::apache2::mod_suphp.c is attached...
 
 With both of these applied and php5-cgi installed I have squirrelmail
 working under suphp again.
 
 --6TrnltStXW4iwmi0
 Content-Type: text/x-csrc; charset=us-ascii
 Content-Disposition: attachment; filename="patch-src::apache2::mod_suphp.c"
 
 --- src/apache2/mod_suphp.c.orig	Tue Jul 13 04:43:41 2004
 +++ src/apache2/mod_suphp.c	Thu Mar  2 20:14:04 2006
 @@ -56,7 +56,7 @@
          return -1;
         
      rv = apr_bucket_read(b, &bucket_data, &bucket_data_len, APR_BLOCK_READ);
 -    if (!APR_STATUS_IS_SUCCESS(rv) || (bucket_data_len == 0))
 +    if (!(rv == APR_SUCCESS) || (bucket_data_len == 0))
      {
          return 0;
      }
 @@ -463,7 +463,13 @@
      
      if (((rv = apr_procattr_create(&procattr, p)) != APR_SUCCESS)
          || ((rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, APR_CHILD_BLOCK)) != APR_SUCCESS)
 +
 +/* XXX: Pending review by both the Apache APR folks, as well as the suPHP folks.  See thread:
 + * http://lists.marsching.biz/pipermail/suphp/2004-July/000756.html
 + */
 +/*
          || ((rv = apr_procattr_dir_set(procattr, ap_make_dirstr_parent(r->pool, r->filename))) != APR_SUCCESS)
 +*/
      
      /* set resource limits */
  
 @@ -524,7 +530,9 @@
              return rv;
          }
          
 -        APR_BRIGADE_FOREACH(bucket, bb)
 + 	for (bucket = APR_BRIGADE_FIRST(bb);
 + 	     bucket != APR_BRIGADE_SENTINEL(bb);
 + 	     bucket = APR_BUCKET_NEXT(bucket))
          {
              const char *data;
              apr_size_t len;
 @@ -595,7 +603,9 @@
              
              const char *buf;
              apr_size_t blen;
 -            APR_BRIGADE_FOREACH(b, bb)
 + 	    for (b = APR_BRIGADE_FIRST(bb);
 + 		 b != APR_BRIGADE_SENTINEL(bb);
 + 		 b = APR_BUCKET_NEXT(b))
              {
                  if (APR_BUCKET_IS_EOS(b))
                      break;
 @@ -616,7 +626,9 @@
              /* empty brigade (script output) */
              const char *buf;
              apr_size_t blen;
 -            APR_BRIGADE_FOREACH(b, bb)
 + 	    for (b = APR_BRIGADE_FIRST(bb);
 + 		 b != APR_BRIGADE_SENTINEL(bb);
 + 		 b = APR_BUCKET_NEXT(b))
              {
                  if (APR_BUCKET_IS_EOS(b))
                      break;
 
 --6TrnltStXW4iwmi0--
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Sat Apr 8 12:56:25 UTC 2006 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94034 
>Unformatted:
