Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2004 21:37:10 -0800 (PST)
From:      Trevor Johnson <trevor@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/61976: PLIST_DOCDIRS and PLIST_DOCFILES
Message-ID:  <20040127053710.949AC16A699@hub.freebsd.org>
Resent-Message-ID: <200401270550.i0R5oB7t028777@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         61976
>Category:       ports
>Synopsis:       PLIST_DOCDIRS and PLIST_DOCFILES
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 26 21:50:10 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Trevor Johnson
>Release:        FreeBSD 5.2-RELEASE i386
>Organization:
N/A
>Environment:
bsd.port.mk 1.483

	
>Description:
	

These are two new macros to complement PLIST_DIRS and PLIST_FILES
(PR 59909) and slightly simplify their use.  PLIST_DOCDIRS is a
list of directories, and PLIST_DOCFILES a list of files, to be
included in the packing list unless NOPORTDOCS is set.  They are
meant to replace the use of %%PORTDOCS%% in the PLIST file.

Here is an example of their use:

	ALL_TARGET=	nogger
	PLIST_FILES=	bin/nogger
	.for ii in COPYING README Thanks
	PLIST_DOCFILES+=	share/doc/nogger/${ii}
	.endfor
	PLIST_DOCDIRS=	share/doc/nogger
	USE_GMAKE=	y

Here is the same thing without the proposed new macros:
 
	ALL_TARGET=	nogger
	PLIST_FILES=	bin/nogger
	.ifndef(NOPORTDOCS)
	.for ii in COPYING README Thanks
	PLIST_FILES+=	share/doc/nogger/${ii}
	.endfor
	PLIST_DIRS=	share/doc/nogger
	.endif
	USE_GMAKE=	y

They would move the check for NOPORTDOCS into bsd.port.mk, adding
12 lines to it.

>How-To-Repeat:
	
Use PLIST_DIRS or PLIST_FILES in a port which respects NOPORTDOCS. 
>Fix:

This patch is also at 
<URL:http://people.freebsd.org/~trevor/ports/docdirs-docfiles.diff>.

Index: /usr/ports/Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.483
diff -u -r1.483 bsd.port.mk
--- /usr/ports/Mk/bsd.port.mk	24 Jan 2004 01:26:30 -0000	1.483
+++ /usr/ports/Mk/bsd.port.mk	27 Jan 2004 05:07:10 -0000
@@ -789,7 +789,9 @@
 #				  if USE_X_PREFIX is set, /etc/mtree/BSD.local.dist
 #				  otherwise.)
 # PLIST_DIRS		- Directories to be added to packing list
+# PLIST_DOCDIRS		- as above, but not added when NOPORTDOCS is set
 # PLIST_FILES		- Files and symbolic links to be added to packing list
+# PLIST_DOCFILES	- as above, but not added when NOPORTDOCS is set
 #
 # PLIST			- Name of the `packing list' file (default: ${PKGDIR}/pkg-plist).
 #				  Change this to ${WRKDIR}/PLIST or something if you
@@ -4687,6 +4689,11 @@
 	@${MKDIR} `dirname ${TMPPLIST}`
 	@if [ ! -f ${DESCR} ]; then ${ECHO_CMD} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
 	@>${TMPPLIST}
+.if !defined(NOPORTDOCS)
+	@for file in ${PLIST_DOCFILES}; do \
+		${ECHO_CMD} $${file} >> ${TMPPLIST}; \
+	done
+.endif
 	@for file in ${PLIST_FILES}; do \
 		${ECHO_CMD} $${file} >> ${TMPPLIST}; \
 	done
@@ -4728,6 +4735,11 @@
 	@if [ -f ${PLIST} ]; then \
 		${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
 	fi
+.if !defined(NOPORTDOCS)
+.for dir in ${PLIST_DOCDIRS}
+	@${ECHO_CMD} ${dir} | ${SED} -e 's,^,@dirrm ,' >> ${TMPPLIST}
+.endfor
+.endif
 .for dir in ${PLIST_DIRS}
 	@${ECHO_CMD} ${dir} | ${SED} -e 's,^,@dirrm ,' >> ${TMPPLIST}
 .endfor
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040127053710.949AC16A699>