From chris@zeus.bayofrum.net  Fri Apr 22 13:28:03 2011
Return-Path: <chris@zeus.bayofrum.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 332CA1065675
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Apr 2011 13:28:03 +0000 (UTC)
	(envelope-from chris@zeus.bayofrum.net)
Received: from mail.skyusermail.com (mail.skyusermail.com [77.240.11.49])
	by mx1.freebsd.org (Postfix) with ESMTP id B86D38FC16
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Apr 2011 13:28:02 +0000 (UTC)
Received: from Spooler by mail.skyusermail.com (Mercury/32 v4.52) ID MO02F460;
    22 Apr 2011 14:28:01 +0100
Received: from spooler by mail.skyusermail.com (Mercury/32 v4.52); 22 Apr 2011 14:27:47 +0100
Received: from zeus.bayofrum.net (90.221.7.100) by mail.skyusermail.com (Mercury/32 v4.52) with ESMTP
  ID MG02F45F (Using SSL/TLS, 3DES, CBC mode, keysize 192 bits) ; 22 Apr 2011 14:27:44 +0100
Received: from zeus.bayofrum.net (crees@localhost [127.0.0.1])
	by zeus.bayofrum.net (8.14.4/8.14.4) with ESMTP id p3MDRAT8027521
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Apr 2011 14:27:10 +0100 (BST)
	(envelope-from chris@zeus.bayofrum.net)
Received: (from crees@localhost)
	by zeus.bayofrum.net (8.14.4/8.14.4/Submit) id p3MDRA61027520;
	Fri, 22 Apr 2011 14:27:10 +0100 (BST)
	(envelope-from chris)
Message-Id: <201104221327.p3MDRA61027520@zeus.bayofrum.net>
Date: Fri, 22 Apr 2011 14:27:10 +0100 (BST)
From: Chris Rees <utisoft@gmail.com>
Reply-To: Chris Rees <utisoft@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Fix port: www/phpmp Remove deprecated PHP clauses & fix for fastcgi
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>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:    kevlo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 22 13:30:10 UTC 2011
>Closed-Date:    Sun Apr 24 06:07:51 UTC 2011
>Last-Modified:  Sun Apr 24 06:10:10 UTC 2011
>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@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
+@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
+@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:
Responsible-Changed-From-To: freebsd-ports-bugs->kevlo 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Apr 22 13:30:22 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156574 
State-Changed-From-To: open->closed 
State-Changed-By: kevlo 
State-Changed-When: Sun Apr 24 06:07:35 UTC 2011 
State-Changed-Why:  
Committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/156574: commit references a PR
Date: Sun, 24 Apr 2011 06:07:24 +0000 (UTC)

 kevlo       2011-04-24 06:07:10 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/phpmp            Makefile pkg-plist 
   Log:
   - Remove deprecated PHP clauses & fix for fastcgi; from Chris Rees
   - Update MASTER_SITES
   PR:     ports/156574
   
   Revision  Changes    Path
   1.3       +19 -2     ports/www/phpmp/Makefile
   1.2       +3 -1      ports/www/phpmp/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
