From nobody@FreeBSD.org  Sun Feb  9 15:03:47 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 DAD0BF89
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Feb 2014 15:03:47 +0000 (UTC)
Received: from newred.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id AA5911C25
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Feb 2014 15:03:47 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by newred.freebsd.org (8.14.7/8.14.7) with ESMTP id s19F3lYf037539
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 9 Feb 2014 15:03:47 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.7/8.14.7/Submit) id s19F3l6t037534;
	Sun, 9 Feb 2014 15:03:47 GMT
	(envelope-from nobody)
Message-Id: <201402091503.s19F3l6t037534@cgiserv.freebsd.org>
Date: Sun, 9 Feb 2014 15:03:47 GMT
From: Kevin Zheng <kevinz5000@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] Fix installation failure without DOCS for devel/cppcheck
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         186588
>Category:       ports
>Synopsis:       [patch] Fix installation failure without DOCS for devel/cppcheck
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bf
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 09 15:10:00 UTC 2014
>Closed-Date:    Wed Mar 05 05:11:25 UTC 2014
>Last-Modified:  Wed Mar 05 05:11:25 UTC 2014
>Originator:     Kevin Zheng
>Release:        10.0-RELEASE
>Organization:
>Environment:
FreeBSD epsilon.local 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
devel/cppcheck installs a man page when DOCS is set. If DOCS is not set, the man page is not installed, but still appears in PLIST_FILES, resulting in an installation failure. There are two ways to solve this problem:

1) Unconditionally install the man page, since they're pretty much essential for everybody (my way)

2) Change the PLIST_FILES to a conditional entry, that is: add the man page only if DOCS is enabled

Personally I like #1, and that's what my patch does.
>How-To-Repeat:
Install devel/cppcheck without DOCS set.
>Fix:
Apply the attached patch.

Patch attached with submission follows:

diff --git a/devel/cppcheck/Makefile b/devel/cppcheck/Makefile
index ad33b23..59a82ba 100644
--- a/devel/cppcheck/Makefile
+++ b/devel/cppcheck/Makefile
@@ -35,7 +35,6 @@ MAKE_ENV+=	CFGDIR="${DATADIR}/cfg"
 PORTDATA=	*
 .endif
 
-.if ${PORT_OPTIONS:MDOCS}
 ALL_TARGET+=	man
 BUILD_DEPENDS+=	xsltproc:${PORTSDIR}/textproc/libxslt \
 		${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:${PORTSDIR}/textproc/docbook-xsl
@@ -43,7 +42,6 @@ MAKE_ENV+=	DB2MAN="${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl"
 
 post-install:
 	@${INSTALL_MAN} ${WRKSRC}/cppcheck.1 ${STAGEDIR}${PREFIX}/man/man1
-.endif
 
 .if ${PORT_OPTIONS:MMATCHCOMPILER}
 MAKE_ENV+=		SRCDIR=build
@@ -59,10 +57,8 @@ post-patch:
 	@${REINPLACE_CMD} \
 	-e 's|-Iexternals -Iexternals/tinyxml|-I${LOCALBASE}/include|' \
 		${WRKSRC}/Makefile
-.if ${PORT_OPTIONS:MDOCS}
 	@${REINPLACE_CMD} -e '\|DB2MAN=|d' \
 		${WRKSRC}/Makefile
-.endif
 .if ${PORT_OPTIONS:MMATCHCOMPILER}
 	@${REINPLACE_CMD} -e 's|python|${PYTHON_CMD}|' \
 		${WRKSRC}/Makefile


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->bf 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Feb 9 15:10:08 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/186588: commit references a PR
Date: Mon,  3 Mar 2014 16:36:44 +0000 (UTC)

 Author: bf
 Date: Mon Mar  3 16:36:37 2014
 New Revision: 346928
 URL: http://svnweb.freebsd.org/changeset/ports/346928
 QAT: https://qat.redports.org/buildarchive/r346928/
 
 Log:
   Correct the plist for the case when the manpage isn't built, and
   use a more specific option name
   
   PR:		186588, 186795
   Submitted by:	amdmi3, K. Zheng
 
 Modified:
   head/devel/cppcheck/Makefile
 
 Modified: head/devel/cppcheck/Makefile
 ==============================================================================
 --- head/devel/cppcheck/Makefile	Mon Mar  3 16:23:58 2014	(r346927)
 +++ head/devel/cppcheck/Makefile	Mon Mar  3 16:36:37 2014	(r346928)
 @@ -20,13 +20,13 @@ ALL_TARGET=	cppcheck
  LDFLAGS+=	-L${LOCALBASE}/lib
  MAKE_ENV+=	TINYXML=-ltinyxml2
  
 -OPTIONS_DEFINE=		MATCHCOMPILER RULES
 -OPTIONS_DEFAULT=	MATCHCOMPILER RULES
 +OPTIONS_DEFINE=		MATCHCOMPILER RULES MANPAGES
 +OPTIONS_DEFAULT=	MATCHCOMPILER RULES MANPAGES
  
  MATCHCOMPILER_DESC=	Build-time optimizations via Python
  RULES_DESC=		User-defined rule support (requires PCRE)
  
 -PLIST_FILES=	bin/cppcheck bin/cppcheck-htmlreport man/man1/cppcheck.1.gz
 +PLIST_FILES=	bin/cppcheck bin/cppcheck-htmlreport
  
  .include <bsd.port.options.mk>
  
 @@ -35,12 +35,14 @@ MAKE_ENV+=	CFGDIR="${DATADIR}/cfg"
  PORTDATA=	*
  .endif
  
 -.if ${PORT_OPTIONS:MDOCS}
 +.if ${PORT_OPTIONS:MMANPAGES}
  ALL_TARGET+=	man
  BUILD_DEPENDS+=	xsltproc:${PORTSDIR}/textproc/libxslt \
  		${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:${PORTSDIR}/textproc/docbook-xsl
  MAKE_ENV+=	DB2MAN="${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl"
  
 +PLIST_FILES+=	man/man1/cppcheck.1.gz
 +
  post-install:
  	@${INSTALL_MAN} ${WRKSRC}/cppcheck.1 ${STAGEDIR}${PREFIX}/man/man1
  .endif
 @@ -59,7 +61,7 @@ post-patch:
  	@${REINPLACE_CMD} \
  	-e 's|-Iexternals -Iexternals/tinyxml|-I${LOCALBASE}/include|' \
  		${WRKSRC}/Makefile
 -.if ${PORT_OPTIONS:MDOCS}
 +.if ${PORT_OPTIONS:MMANPAGES}
  	@${REINPLACE_CMD} -e '\|DB2MAN=|d' \
  		${WRKSRC}/Makefile
  .endif
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: bf 
State-Changed-When: Wed Mar 5 05:11:24 UTC 2014 
State-Changed-Why:  
The problem was solved using the approach of PR ports/186795.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186588 
>Unformatted:
