ports/165720: [PATCH] www/suphp: [Add support for lighttpd]

Michael Ranner michael at ranner.eu
Mon Mar 5 16:40:12 UTC 2012


>Number:         165720
>Category:       ports
>Synopsis:       [PATCH] www/suphp: [Add support for lighttpd]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 05 16:40:11 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Charlie &
>Release:        FreeBSD 8.2-RELEASE i386
>Organization:
>Environment:
System: FreeBSD bender.azedo.at 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011
>Description:
Add support for lighttpd

Added file(s):
- files/lighttpd-suphp.conf.in
- files/pkg-message.in

Removed file(s):
- pkg-message

Port maintainer (yzlin at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_4 (mode: change, diff: ports)
>How-To-Repeat:
>Fix:

--- suphp-0.7.1_6.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/www/suphp/Makefile ./Makefile
--- /usr/ports/www/suphp/Makefile	2012-03-04 19:50:10.000000000 +0100
+++ ./Makefile	2012-03-04 20:04:06.000000000 +0100
@@ -7,7 +7,7 @@
 
 PORTNAME=	suphp
 PORTVERSION=	0.7.1
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	www
 MASTER_SITES=	http://www.suphp.org/download/ \
 		${MASTER_SITE_LOCAL:S|%SUBDIR%|koitsu|}
@@ -15,18 +15,23 @@
 MAINTAINER=	yzlin at FreeBSD.org
 COMMENT=	Securely execute PHP scripts under Apache or lighttpd
 
+OPTIONS=	APACHE "Build with apache" on \
+			LIGHTY "Build with lighttpd" off
+SUB_FILES=	pkg-message
 GNU_CONFIGURE=	yes
 USE_AUTOTOOLS=	aclocal:env automake:env autoconf:env libtool:env
 
+.if defined(WITH_APACHE)
 # Maintainer has not tested suPHP 0.6.x on Apache 1.3.
 USE_APACHE=	20+
+.endif
 CFLAGS+=	-I${LOCALBASE}/include
 USE_PHP=	yes
 WANT_PHP_CGI=	yes
 
 MYPORTDOCS=	apache/CONFIG apache/INSTALL apache/README CONFIG LICENSE INSTALL README
 
-CONFIGURE_ARGS=	CFLAGS="${CFLAGS}" --with-apxs=${APXS}
+CONFIGURE_ARGS=	CFLAGS="${CFLAGS}"
 
 # WITH_SETID_MODE should be a value of "owner", "force", or "paranoid".
 # It's important that you understand the differences between each mode.
@@ -37,8 +42,30 @@
 
 .include <bsd.port.pre.mk>
 
+.if defined(WITH_APACHE)
+CONFIGURE_ARGS+=	--with-apxs=${APXS}
+PLIST_FILES+=		%%APACHEMODDIR%%/mod_suphp.so \
+						"@exec %D/sbin/apxs -e -a -n suphp %D/%f" \
+						"@unexec %D/sbin/apxs -e -A -n suphp %D/%f"
+.else
+LIB_DEPENDS+=		apr-1:${PORTSDIR}/devel/apr1
+APR_CONFIG=			${LOCALBASE}/bin/apr-1-config
+APU_CONFIG=			${LOCALBASE}/bin/apu-1-config
+.endif
+
+.if defined(WITH_LIGHTY)
+RUN_DEPENDS+=		${LOCALBASE}/sbin/lighttpd:${PORTSDIR}/www/lighttpd
+PLIST_FILES+=		etc/lighttpd/conf.d/suphp.conf.sample
+.endif
+
 CONFIGURE_ARGS+=	--with-apr=${LOCALBASE}
 
+.if defined(WITH_APACHE)
+.if defined(WITH_LIGHTY)
+BROKEN=		choose only apache or lighttpd
+.endif
+.endif
+
 AUTOTOOLSFILES=	aclocal.m4
 
 post-patch:
@@ -47,6 +74,10 @@
 			  -e 's|1.10|%%AUTOMAKE_VERSION%%|g' \
 			  ${WRKSRC}/aclocal.m4
 	@${CHMOD} 755 ${WRKSRC}/config/install-sh
+.if defined(WITH_LIGHTY)
+	${SED} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
+		<${FILESDIR}/lighttpd-suphp.conf.in >${WRKDIR}/lighttpd-suphp.conf
+.endif
 
 post-install:
 .if !defined(NOPORTDOCS)
@@ -60,7 +91,12 @@
 	@${STRIP_CMD} ${PREFIX}/sbin/suphp
 .endif
 	@${INSTALL_DATA} ${WRKSRC}/doc/suphp.conf-example ${PREFIX}/etc/suphp.conf-example
+.if defined(WITH_APACHE)
 	@${APXS} -e -a -n "${SHORTMODNAME}" "${APACHEMODDIR}/mod_${MODULENAME}.so"
+.endif
+.if defined(WITH_LIGHTY)
+	@${INSTALL_DATA} ${WRKDIR}/lighttpd-suphp.conf ${PREFIX}/etc/lighttpd/conf.d/suphp.conf.sample
+.endif
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
diff -ruN --exclude=CVS /usr/ports/www/suphp/files/lighttpd-suphp.conf.in ./files/lighttpd-suphp.conf.in
--- /usr/ports/www/suphp/files/lighttpd-suphp.conf.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/lighttpd-suphp.conf.in	2012-03-04 20:08:32.000000000 +0100
@@ -0,0 +1,49 @@
+#######################################################################
+##
+##  suPHP config
+## -------------- 
+##
+## http://www.suphp.org/
+##
+
+##
+## mod_setenv - required to create environment for suphp
+##
+#server.modules += ( "mod_setenv" )
+
+##
+## Setup suphp environment to handle php files
+##
+$HTTP["url"] =~ ".php$" {
+  setenv.add-environment = (
+    "SUPHP_HANDLER" => "application/x-httpd-php"
+  )
+}
+
+##
+## mod_cgi - required for suphp
+##
+#server.modules += ( "mod_cgi" )
+
+##
+## Uncomment to enable suphp to handle other cgi scripts
+##
+#$HTTP["url"] =~ ".pl|.py|.cgi$" {
+#  setenv.add-environment = (
+#    "SUPHP_HANDLER" => "x-suphp-cgi"
+#  )
+#}
+
+##
+## Assign suphp to handle php files
+##
+cgi.assign += (
+  ## Uncomment the following if you want suphp to handle other cgi scripts
+  #".pl" => "%%LOCALBASE%%/sbin/suphp",
+  #".py" => "%%LOCALBASE%%/sbin/suphp",
+  #".cgi" => "%%LOCALBASE%%/sbin/suphp",
+  ".php" => "%%LOCALBASE%%/sbin/suphp"
+)
+
+#
+#######################################################################
diff -ruN --exclude=CVS /usr/ports/www/suphp/files/pkg-message.in ./files/pkg-message.in
--- /usr/ports/www/suphp/files/pkg-message.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pkg-message.in	2012-03-04 20:08:32.000000000 +0100
@@ -0,0 +1,68 @@
+----------------------------------------------------------------
+For help on using this module, please see the suPHP homepage:
+
+        http://www.suphp.org/
+
+Using suPHP can break some PHP-scripts, because of Apache's CGI 
+interface.
+-----------------------------------------------------------------
+
+-----------------------------------------------------------------
+For those migrating from suPHP 0.5.x, be aware there are many
+changes since 0.6.x that can cause your current Apache environment
+to stop working or behave oddly.  Here are two migration tips:
+
+suPHP now uses a configuration file for runtime configuration.
+The file is located at:
+
+        %%PREFIX%%/etc/suphp.conf
+
+...but *has not* been created for you.  A sample configuration
+file has been installed here:
+
+        %%PREFIX%%/etc/suphp.conf-example
+
+This means that many of the make.conf(5) knobs for the
+www/suphp port are no longer used, and are modifiable in
+real-time; thus, things like WITHOUT_CHECKPATH and SUPHP_PATH
+are no longer needed.  Instead, edit the config file.
+
+Equally as important, suPHP no longer uses a static MIME type
+for determining what content get handled by suPHP.  In 0.5.x,
+you used the following Apache directives:
+
+        suPHP_Engine on
+        AddType application/x-httpd-php .php
+        AddHandler x-httpd-php .php
+
+Since suPHP 0.6.x, you should use the following:
+
+        suPHP_Engine on
+        AddType application/x-httpd-php .php
+        suPHP_AddHandler application/x-httpd-php
+
+Otherwise, Apache will begin serving PHP files as downloadable
+content, rather than parse them with the PHP interpreter.
+-----------------------------------------------------------------
+
+-----------------------------------------------------------------
+If you use suPHP for lighttpd, copy conf.d/suphp.conf.sample to
+conf.d/suphp.conf and add
+
+	include "conf.d/suphp.conf"
+
+to the lighttpd.conf file.
+-----------------------------------------------------------------
+
+-----------------------------------------------------------------
+For those versions upgraded from 0.6.x to 0.7.x. There are some
+new features and changes for the configuration file:
+
+    - Multiple path (with patterns) & variable substitution
+      support for docroots
+    - Double-quoted strings at section '[handlers]'
+      ex. application/x-httpd-php="php:%%PREFIX%%/bin/php-cgi"
+
+These changes may lead to internal server error if without
+modifications of the configuration file from previous version.
+-----------------------------------------------------------------
diff -ruN --exclude=CVS /usr/ports/www/suphp/pkg-message ./pkg-message
--- /usr/ports/www/suphp/pkg-message	2009-03-20 08:33:13.000000000 +0100
+++ ./pkg-message	1970-01-01 01:00:00.000000000 +0100
@@ -1,59 +0,0 @@
-----------------------------------------------------------------
-For help on using this module, please see the suPHP homepage:
-
-        http://www.suphp.org/
-
-Using suPHP can break some PHP-scripts, because of Apache's CGI 
-interface.
------------------------------------------------------------------
-
------------------------------------------------------------------
-For those migrating from suPHP 0.5.x, be aware there are many
-changes since 0.6.x that can cause your current Apache environment
-to stop working or behave oddly.  Here are two migration tips:
-
-suPHP now uses a configuration file for runtime configuration.
-The file is located at:
-
-        /usr/local/etc/suphp.conf
-
-...but *has not* been created for you.  A sample configuration
-file has been installed here:
-
-        /usr/local/etc/suphp.conf-example
-
-This means that many of the make.conf(5) knobs for the
-www/suphp port are no longer used, and are modifiable in
-real-time; thus, things like WITHOUT_CHECKPATH and SUPHP_PATH
-are no longer needed.  Instead, edit the config file.
-
-Equally as important, suPHP no longer uses a static MIME type
-for determining what content get handled by suPHP.  In 0.5.x,
-you used the following Apache directives:
-
-        suPHP_Engine on
-        AddType application/x-httpd-php .php
-        AddHandler x-httpd-php .php
-
-Since suPHP 0.6.x, you should use the following:
-
-        suPHP_Engine on
-        AddType application/x-httpd-php .php
-        suPHP_AddHandler application/x-httpd-php
-
-Otherwise, Apache will begin serving PHP files as downloadable
-content, rather than parse them with the PHP interpreter.
------------------------------------------------------------------
-
------------------------------------------------------------------
-For those versions upgraded from 0.6.x to 0.7.x. There are some
-new features and changes for the configuration file:
-
-    - Multiple path (with patterns) & variable substitution
-      support for docroots
-    - Double-quoted strings at section '[handlers]'
-      ex. application/x-httpd-php="php:/usr/local/bin/php-cgi"
-
-These changes may lead to internal server error if without
-modifications of the configuration file from previous version.
------------------------------------------------------------------
diff -ruN --exclude=CVS /usr/ports/www/suphp/pkg-plist ./pkg-plist
--- /usr/ports/www/suphp/pkg-plist	2007-12-11 21:38:58.000000000 +0100
+++ ./pkg-plist	2012-03-04 20:08:38.000000000 +0100
@@ -1,8 +1,5 @@
 sbin/suphp
 etc/suphp.conf-example
-%%APACHEMODDIR%%/mod_suphp.so
- at exec %D/sbin/apxs -e -a -n suphp %D/%f
- at unexec %D/sbin/apxs -e -A -n suphp %D/%f
 %%PORTDOCS%%%%DOCSDIR%%/INSTALL
 %%PORTDOCS%%%%DOCSDIR%%/LICENSE
 %%PORTDOCS%%%%DOCSDIR%%/README
--- suphp-0.7.1_6.patch ends here ---

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



More information about the freebsd-ports-bugs mailing list