From nobody@FreeBSD.org  Wed May 28 23:12:40 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 6925CE12
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 28 May 2014 23:12:40 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id 49A2B2055
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 28 May 2014 23:12:40 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SNCec7049092
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 28 May 2014 23:12:40 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s4SNCelK049089;
	Wed, 28 May 2014 23:12:40 GMT
	(envelope-from nobody)
Message-Id: <201405282312.s4SNCelK049089@cgiserv.freebsd.org>
Date: Wed, 28 May 2014 23:12:40 GMT
From: Joseph Benden <joe@thrallingpenguin.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] Add staging support to www/podcastamatic
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: lars.eggert@gmx.net

>Number:         190360
>Category:       ports
>Synopsis:       [patch] Add staging support to www/podcastamatic
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    swills
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 28 23:20:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Wed May 28 23:30:00 UTC 2014
>Originator:     Joseph Benden
>Release:        FreeBSD 11
>Organization:
>Environment:
FreeBSD lucy 11.0-CURRENT FreeBSD 11.0-CURRENT #4 r264887: Thu Apr 24 12:43:46 MST 2014     root@lucy:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Adds staging support to www/podcastamatic.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff --git a/www/podcastamatic/Makefile b/www/podcastamatic/Makefile
index 1f8f7c3..121d7f3 100644
--- a/www/podcastamatic/Makefile
+++ b/www/podcastamatic/Makefile
@@ -17,10 +17,13 @@ RUN_DEPENDS=	p5-MP3-Info>=0:${PORTSDIR}/audio/p5-MP3-Info \
 
 USES=		perl5 zip
 USE_PERL5=	run
-
+USES+=		shebangfix
+SHEBANG_FILES=	podcastamatic.pl
 NO_BUILD=	yes
 
-NO_STAGE=	yes
+SUB_LIST=	PORTNAME="${PORTNAME}"
+SUB_FILES=	pkg-message
+
 do-patch:
 	@${REINPLACE_CMD} -e "s|${PORTNAME}.conf|${PREFIX}/etc/${PORTNAME}.conf|"\
 		 ${WRKSRC}/${PORTNAME}.pl
@@ -35,18 +38,16 @@ do-patch:
 	@${REINPLACE_CMD} -e "s|[wW]:|${PREFIX}/www|" ${WRKSRC}/example_${PORTNAME}.conf
 
 do-install:
-	@${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME}.pl ${PREFIX}/bin/${PORTNAME}
-	@${INSTALL_DATA} ${WRKSRC}/example_${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf.sample
-	test \! -f ${PREFIX}/etc/${PORTNAME}.conf && ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf || true
-	@${MKDIR} ${PREFIX}/share/${PORTNAME}
-	@${INSTALL_DATA} ${WRKSRC}/style.css ${PREFIX}/share/${PORTNAME}/
+	@${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME}.pl ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+	@${INSTALL_DATA} ${WRKSRC}/example_${PORTNAME}.conf ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/${PORTNAME}
+	@${INSTALL_DATA} ${WRKSRC}/style.css ${STAGEDIR}${PREFIX}/share/${PORTNAME}/
 .if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-	@${INSTALL_DATA} ${WRKSRC}/readme.html ${DOCSDIR}
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	@${INSTALL_DATA} ${WRKSRC}/readme.html ${STAGEDIR}${DOCSDIR}
 .endif
-	@${ECHO}
-	@${ECHO} "Edit ${PREFIX}/etc/${PORTNAME}.conf"
-	@${ECHO} "CSS in ${PREFIX}/share/${PORTNAME}/style.css"
-	@${ECHO}
+
+post-install:
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>
diff --git a/www/podcastamatic/files/pkg-message.in b/www/podcastamatic/files/pkg-message.in
new file mode 100644
index 0000000..000e68f
--- /dev/null
+++ b/www/podcastamatic/files/pkg-message.in
@@ -0,0 +1,4 @@
+
+Edit %%PREFIX%%/etc/%%PORTNAME%%.conf
+CSS in %%PREFIX%%/share/%%PORTNAME%%/style.css
+
diff --git a/www/podcastamatic/pkg-plist b/www/podcastamatic/pkg-plist
index c4d411d..38e4b66 100644
--- a/www/podcastamatic/pkg-plist
+++ b/www/podcastamatic/pkg-plist
@@ -1,7 +1,7 @@
-@unexec cmp %D/etc/podcastamatic.conf.sample %D/etc/podcastamatic.conf && rm %D/etc/podcastamatic.conf || true
 bin/podcastamatic
+@unexec if cmp -s %D/etc/podcastamatic.conf %D/etc/podcastamatic.conf.sample; then rm -f %D/etc/podcastamatic.conf; fi
 etc/podcastamatic.conf.sample
-@exec [ -f %B/podcastamatic.conf ] || cp %F %B/podcastamatic.conf
+@exec cp -n %D/%F %B/podcastamatic.conf
 %%PORTDOCS%%%%DOCSDIR%%/readme.html
 %%DATADIR%%/style.css
 @dirrm %%DATADIR%%


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->swills 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed May 28 23:20:04 UTC 2014 
Responsible-Changed-Why:  
swills@ wants this submitter's PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=190360 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Wed May 28 23:20:06 UTC 2014 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: lars.eggert@gmx.net
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/190360: [patch] Add staging support to www/podcastamatic
Date: Wed, 28 May 2014 23:20:05 UT

 Maintainer of www/podcastamatic,
 
 Please note that PR ports/190360 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/190360
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
>Unformatted:
