Bug 156574 - [PATCH] Fix port: www/phpmp Remove deprecated PHP clauses & fix for fastcgi
Summary: [PATCH] Fix port: www/phpmp Remove deprecated PHP clauses & fix for fastcgi
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Kevin Lo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 14:30 UTC by Chris Rees
Modified: 2011-04-24 07:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rees 2011-04-22 14:30:10 UTC
	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.

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

	Submitted by: Chris Rees (utisoft_at_gmail.com)



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.--n0fFEcPDEdI5ff0RgtKO6pumqYKAXtjZC6VSThS3nAoRkt8I
Content-Type: text/plain; name="phpmp-fix-fastcgi.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="phpmp-fix-fastcgi.diff"

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
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
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-04-22 14:30:22 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kevlo

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2011-04-24 07:07:24 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"
Comment 3 Kevin Lo freebsd_committer freebsd_triage 2011-04-24 07:07:35 UTC
State Changed
From-To: open->closed

Committed, thanks!