Bug 186588 - [patch] Fix installation failure without DOCS for devel/cppcheck
Summary: [patch] Fix installation failure without DOCS for devel/cppcheck
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: Brendan Fabeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-09 15:10 UTC by Kevin Zheng
Modified: 2014-03-05 05:11 UTC (History)
0 users

See Also:


Attachments
file.diff (1013 bytes, patch)
2014-02-09 15:10 UTC, Kevin Zheng
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Zheng 2014-02-09 15:10:00 UTC
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.

Fix: Apply the attached patch.

Patch attached with submission follows:
How-To-Repeat: Install devel/cppcheck without DOCS set.
Comment 1 Edwin Groothuis freebsd_committer 2014-02-09 15:10:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bf

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2014-03-03 16:36:44 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"
Comment 3 Brendan Fabeny freebsd_committer 2014-03-05 05:11:24 UTC
State Changed
From-To: open->closed

The problem was solved using the approach of PR ports/186795.  Thanks!