ports/123964: Mk fix: bsd.linux-rpm.mk - Handling of NOPORTDOCS

Ganael Laplanche ganael.laplanche at martymac.com
Sat May 24 20:50:04 UTC 2008

>Number:         123964
>Category:       ports
>Synopsis:       Mk fix: bsd.linux-rpm.mk - Handling of NOPORTDOCS
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 24 20:50:03 UTC 2008
>Originator:     Ganael Laplanche
>Release:        8.0-CURRENT
FreeBSD home.martymac.com 8.0-CURRENT FreeBSD 8.0-CURRENT #17: Sun May 18 23:44:45 CEST 2008     root@:/usr/obj/usr/src/sys/MYKERNEL  amd64
As discussed in this thread :


bsd.linux-rpm.mk ignores PORTDOCS and NOPORTDOCS variables. A port using USE_LINUX_RPM will have *every* files in WRKDIR (including documentation) installed.

This leads to incorrect plist generation when both NOPORTDOCS and PORTDOCS are defined : the do-install target of bsd.linux-rpm.mk will unconditionally install documentation files, while the plist file will not include them if NOPORTDOCS is defined. When deinstalling the port, if NOPORTDOCS has been defined, documentation files are left installed.

The attached patch removes PORTDOCS from WRKDIR at pre-patch stage if NOPORTDOCS is defined, so that documentation files will not be installed.

Note : As far as I can see, 3 ports are involved in such a situation :
- archivers/linux-par2cmdline
- graphics/linux-png
- graphics/linux-png10
cd /usr/ports/archivers/linux-par2cmdline
make -DNOPORTDOCS install
make -DNOPORTDOCS deinstall
ls /compat/linux/usr/share/doc/par2cmdline-0.4

The last command shows documentation has been installed and left behind after deinstallation.

Patch attached with submission follows:

--- bsd.linux-rpm.mk.orig	2008-05-24 20:46:04.931665759 +0200
+++ bsd.linux-rpm.mk	2008-05-24 21:32:51.721449935 +0200
@@ -105,6 +105,20 @@
+# For ports that define PORTDOCS, be sure not to install
+# documentation if NOPORTDOCS is defined
+.if defined(PORTDOCS) && defined(NOPORTDOCS)
+pre-patch: linux-rpm-clean-portdocs
+.  if !target(linux-rpm-clean-portdocs)
+.for x in ${PORTDOCS}
+	@${RM} -f ${WRKDIR}/${DOCSDIR_REL}/${x}
+.  endif
 .  if defined(AUTOMATIC_PLIST)
 .    if ${USE_LINUX} == "fc4" || ${USE_LINUX:L} == "yes"


More information about the freebsd-ports-bugs mailing list