Date: Thu, 09 Oct 2003 03:33:34 +0200 From: Oliver Eikemeier <eikemeier@fillmore-labs.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/57778: [PATCH] bsd.port.mk: proposal for a PORTDOCS macro Message-ID: <3F84BAEE.10800@fillmore-labs.com> Resent-Message-ID: <200310090140.h991eD24027843@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 57778 >Category: ports >Synopsis: [PATCH] bsd.port.mk: proposal for a PORTDOCS macro >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 08 18:40:13 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Oliver Eikemeier >Release: FreeBSD 5.1-CURRENT i386 >Organization: Fillmore Labs - http://www.fillmore-labs.com >Environment: System: FreeBSD nuuk.fillmore-labs.com 5.1-CURRENT >Description: Like MAN and INFO, ports will benefit from automatic processing of package list installation/deinstallation code for documentation files: - no need to track changing documentation - smaller hardcoded pkg-plist A good example is for a port that would benefit is port databases/db41. This patch only generates the pkg-plist code for installed documentation, it does not install any files, in the spirit of MAN and INFO. The port should set PORTDOCS to a list of files and directories relative to DOCSDIR. Shell glob patterns can be used, directories include the entire subtree of contained files and directories. The port should not set PORTDOCS when no documentation files are installed (for example because NOPORTDOCS is defined) Examples: PORTDOCS= * => everything under DOCSDIR belongs to this package PORTDOCS= README ChangeLog => files can be listed seperately PORTDOCS= README client => this port shares DOCSDIR (maybe because it it a slave port) and installs ${DOCSDIR}/README and all files in the subtreee ${DOCSDIR}/client Currently 27 ports define PORTDOCS: - audio/libsndfile - deskutils/teapot - editors/biew - emulators/xgs - games/omega - graphics/cqcam - graphics/graphviz - graphics/qvplay - irc/quirc - japanese/elisa8x8 - japanese/ng - japanese/ng-devel - lang/cu-prolog - lang/yorick - mail/im - mail/smtpfeed - misc/ewipe - multimedia/nxtvepg - net/rwhois - security/libbf - security/srp - security/ssh2 - sysutils/apcupsd - sysutils/tct - x11-fm/dfm - x11-fm/gentoo - x11-wm/larswm I'll provide patches for them if nobody comes up with a better name. >How-To-Repeat: >Fix: --- bsd.port.mk.patch begins here --- --- bsd.port.mk.orig 3 Sep 2003 19:50:24 -0000 +++ bsd.port.mk 9 Oct 2003 00:51:13 -0000 @@ -3319,7 +3319,7 @@ generate-plist check-already-installed _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ pre-su-install-script do-install add-plist-info post-install \ - post-install-script compress-man run-ldconfig fake-pkg \ + post-install-script add-plist-docs compress-man run-ldconfig fake-pkg \ security-check _PACKAGE_DEP= install _PACKAGE_SEQ= package-message pre-package pre-package-script \ @@ -4357,6 +4357,22 @@ ${TMPPLIST}: @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} generate-plist + +.if !target(add-plist-docs) +add-plist-docs: +.if defined(PORTDOCS) + @if [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | tail -n 1`" != "${PREFIX}" ]; then \ + ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ + fi + @${FIND} -P ${PORTDOCS:S/^/${DOCSDIR}\//} -not -type d 2>/dev/null | \ + ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST} + @${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \ + ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} + @${ECHO_CMD} "@unexec rmdir %D/${DOCSDIR:S,^${PREFIX}/,,} 2>/dev/null || true" >> ${TMPPLIST} +.else + @${DO_NADA} +.endif +.endif add-plist-info: # Process GNU INFO files at package install/deinstall time --- bsd.port.mk.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F84BAEE.10800>