ports/78490: Update port: Mk/bsd.port.mk add PORTEXAMPLES and PORTDATA

Marcus Grando marcus at corp.grupos.com.br
Sun Mar 6 15:20:03 UTC 2005


>Number:         78490
>Category:       ports
>Synopsis:       Update port: Mk/bsd.port.mk add PORTEXAMPLES and PORTDATA
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 06 15:20:02 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Marcus Grando
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
Grupos Internet S/A
>Environment:
System: FreeBSD corp.grupos.com.br 4.11-STABLE FreeBSD 4.11-STABLE #42: Sun Feb 27 20:04:47 BRT 2005 root at corp.grupos.com.br:/usr/obj/usr/src/sys/CORP i386


	
>Description:
Update port: Mk/bsd.port.mk add PORTEXAMPLES and PORTDATA

* Add PORTEXAMPLES and PORTDATA for dynamic generation files.

	
>How-To-Repeat:
	
>Fix:

	

--- bsd.port.mk.patch2 begins here ---
--- bsd.port.mk.orig	Sun Mar  6 12:09:35 2005
+++ bsd.port.mk	Sun Mar  6 12:13:28 2005
@@ -582,6 +582,26 @@
 #				  installed (for example because NOPORTDOCS is defined).
 #				  Useful for dynamically generated documentation.
 #
+# Set the following to specify all documentation your port installs into
+# ${EXAMPLESDIR}
+#
+# PORTEXAMPLES		- A list of files and directories relative to EXAMPLESDIR.
+#				  Shell glob patterns can be used, directories include
+#				  the entire subtree of contained files and directories.
+#				  Should not be set when no examples files are
+#				  installed (for example because NOPORTEXAMPLES is defined).
+#				  Useful for dynamically generated examples.
+#
+# Set the following to specify all documentation your port installs into
+# ${DATADIR}
+#
+# PORTDATA		- A list of files and directories relative to DATADIR.
+#				  Shell glob patterns can be used, directories include
+#				  the entire subtree of contained files and directories.
+#				  Should not be set when no data files are
+#				  installed (for example because NOPORTDATA is defined).
+#				  Useful for dynamically generated data files.
+#
 # Default targets and their behaviors:
 #
 # fetch			- Retrieves ${DISTFILES} (and ${PATCHFILES} if defined)
@@ -1395,6 +1415,18 @@
 PLIST_SUB+=	        PORTDOCS=""
 .endif
 
+.if defined(NOPORTEXAMPLES)
+PLIST_SUB+=	        PORTEXAMPLES="@comment "
+.else
+PLIST_SUB+=	        PORTEXAMPLES=""
+.endif
+
+.if defined(NOPORTDATA)
+PLIST_SUB+=	        PORTDATA="@comment "
+.else
+PLIST_SUB+=	        PORTDATA=""
+.endif
+
 CONFIGURE_SHELL?=	${SH}
 MAKE_SHELL?=	${SH}
 
@@ -3715,7 +3747,8 @@
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script do-install post-install \
 				post-install-script add-plist-info add-plist-docs \
-				add-plist-post install-rc-script compress-man run-ldconfig \
+				add-plist-examples add-plist-data add-plist-post \
+				install-rc-script compress-man run-ldconfig \
 				fake-pkg security-check
 _PACKAGE_DEP=	install
 _PACKAGE_SEQ=	package-message pre-package pre-package-script \
@@ -4812,6 +4845,40 @@
 	@${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/, at dirrm ,p' >> ${TMPPLIST}
 	@${ECHO_CMD} "@dirrm ${DOCSDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST}
+.else
+	@${DO_NADA}
+.endif
+.endif
+
+.if !target(add-plist-examples)
+add-plist-examples:
+.if defined(PORTEXAMPLES)
+	@if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \
+		[ "`${SED} -En -e '/^@cw?d[ 	]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \
+		${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
+	fi
+	@${FIND} -P ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} ! -type d 2>/dev/null | \
+		${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST}
+	@${FIND} -P -d ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} -type d 2>/dev/null | \
+		${SED} -ne 's,^${PREFIX}/, at dirrm ,p' >> ${TMPPLIST}
+	@${ECHO_CMD} "@dirrm ${EXAMPLESDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST}
+.else
+	@${DO_NADA}
+.endif
+.endif
+
+.if !target(add-plist-data)
+add-plist-data:
+.if defined(PORTDATA)
+	@if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \
+		[ "`${SED} -En -e '/^@cw?d[ 	]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \
+		${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
+	fi
+	@${FIND} -P ${PORTDATA:S/^/${DATADIR}\//} ! -type d 2>/dev/null | \
+		${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST}
+	@${FIND} -P -d ${PORTDATA:S/^/${DATADIR}\//} -type d 2>/dev/null | \
+		${SED} -ne 's,^${PREFIX}/, at dirrm ,p' >> ${TMPPLIST}
+	@${ECHO_CMD} "@dirrm ${DATADIR:S,^${PREFIX}/,,}" >> ${TMPPLIST}
 .else
 	@${DO_NADA}
 .endif
--- bsd.port.mk.patch2 ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list