ports/156574: [PATCH] Fix port: www/phpmp Remove deprecated PHP clauses & fix for fastcgi

Chris Rees utisoft at gmail.com
Fri Apr 22 13:30:11 UTC 2011


>Number:         156574
>Category:       ports
>Synopsis:       [PATCH] Fix port: www/phpmp Remove deprecated PHP clauses & fix for fastcgi
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 22 13:30:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-RELEASE i386
>Organization:
>Environment:
System: FreeBSD zeus.bayofrum.net 8.2-RELEASE FreeBSD 8.2-RELEASE #1: Sun Feb 27 22:19:51 UTC 2011 root at zeus.bayofrum.net:/usr/obj/usr/src/sys/ZEUS i386


	
>Description:
	musicpd no longer supports incremental volume, so recent versions give an error when one uses phpmp to change the volume.

	Also, the use of deprecated variables HTTP_*_VARS plays havoc with fastcgi & lighttpd.

	Config file should not be clobbered on upgrades etc.
>How-To-Repeat:
	Change the volume using phpmp on recent mpd

	Try to use phpmp with lighttpd and fastcgi

	Reinstall with a customised config file
>Fix:

	- Stop clobbering config.php
	- Fix use of deprecated PHP variables
	- Disable volume control by default

	Submitted by: Chris Rees (utisoft_at_gmail.com)

--- phpmp-fix-fastcgi.diff begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/www/phpmp/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	10 Jun 2008 01:23:30 -0000	1.2
+++ Makefile	22 Apr 2011 13:02:23 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	phpmp
 PORTVERSION=	0.11.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 MASTER_SITES=	http://mercury.chem.pitt.edu/~shank/
 DISTNAME=	phpMp-${PORTVERSION}
@@ -21,10 +21,27 @@
 PHPMP?=		www/phpmp
 PLIST_SUB+=	PHPMP=${PHPMP}
 
+post-patch:
+# Replace deprecated HTTP_(GET|POST)_VARS with _(GET|POST)
+	@${REINPLACE_CMD} -e 's#HTTP\(_[^_]*\)_VARS#\1#' \
+		${WRKSRC}/playlist.php ${WRKSRC}/main_body.php
+# Stop clobbering config.php & disable volume control by default;
+# incremental volume changes no longer supported by musicpd
+	@${MV} ${WRKSRC}/config.php ${WRKSRC}/config.php.sample
+	@${REINPLACE_CMD} -e 's/^\(.display_volume[^"]*"\)yes/\1no/' \
+		${WRKSRC}/config.php.sample
+	@${RM} ${WRKSRC}/*.bak
+
 do-install:
 	@${MKDIR} ${PREFIX}/${PHPMP}
 	@${CP} -R ${WRKSRC}/ ${PREFIX}/${PHPMP}
 	@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/${PHPMP}
 	@${CHMOD} -R 755 ${PREFIX}/${PHPMP}
 
+post-install:
+	@if [ ! -f ${PREFIX}/${PHPMP}/config.php ]; then \
+		${CP} -p ${PREFIX}/${PHPMP}/config.php.sample \
+			${PREFIX}/${PHPMP}/config.php ; \
+	fi
+
 .include <bsd.port.mk>
Index: pkg-plist
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/www/phpmp/pkg-plist,v
retrieving revision 1.1
diff -u -r1.1 pkg-plist
--- pkg-plist	27 Feb 2007 03:45:35 -0000	1.1
+++ pkg-plist	22 Apr 2011 13:02:23 -0000
@@ -3,7 +3,9 @@
 %%PHPMP%%/INSTALL
 %%PHPMP%%/README
 %%PHPMP%%/TODO
-%%PHPMP%%/config.php
+ at unexec if cmp -s %D/%%PHPMP%%/config.php.sample %D/%%PHPMP%%/config.php; then rm -f %D/%%PHPMP%%/config.php; fi
+%%PHPMP%%/config.php.sample
+ at exec if [ ! -f %D/%%PHPMP%%/config.php ] ; then cp -p %D/%F %B/config.php; fi
 %%PHPMP%%/find.php
 %%PHPMP%%/find_body.php
 %%PHPMP%%/index.php
--- phpmp-fix-fastcgi.diff ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



More information about the freebsd-ports-bugs mailing list