Index: bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.529 diff -u -r1.529 bsd.port.mk --- bsd.port.mk 23 Feb 2006 15:37:20 -0000 1.529 +++ bsd.port.mk 28 Feb 2006 17:05:00 -0000 @@ -585,6 +585,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) @@ -1456,6 +1476,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} @@ -3779,7 +3811,8 @@ _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ pre-su-install-script do-install install-desktop-entries \ post-install post-install-script add-plist-info \ - add-plist-docs add-plist-post install-rc-script compress-man \ + add-plist-docs 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 \ @@ -5022,6 +5055,54 @@ .endif .endif +.if !target(add-plist-examples) +add-plist-examples: +.if defined(PORTEXAMPLES) && !defined(NOPORTEXAMPLES) + @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 +.for x in ${PORTEXAMPLES} + @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \ + if [ ! -e ${EXAMPLESDIR}/${x} ]; then \ + ${ECHO_CMD} ${EXAMPLESDIR}/${x} | \ + ${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \ + fi;fi +.endfor + @${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}/,@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) && !defined(NOPORTDATA) + @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 +.for x in ${PORTDATA} + @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \ + if [ ! -e ${DATADIR}/${x} ]; then \ + ${ECHO_CMD} ${DATADIR}/${x} | \ + ${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \ + fi;fi +.endfor + @${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}/,@dirrm ,p' >> ${TMPPLIST} + @${ECHO_CMD} "@dirrm ${DATADIR:S,^${PREFIX}/,,}" >> ${TMPPLIST} +.else + @${DO_NADA} +.endif +.endif + .if !target(add-plist-info) add-plist-info: # Process GNU INFO files at package install/deinstall time