Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2007 19:33:57 -0600 (MDT)
From:      "John E. Hein" <jhein@timing.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/114545: [patch] for bsd.port.mk to fix linux-xorg-libs ldconfig when using pkg_add -p
Message-ID:  <200707130133.l6D1Xv8u025248@gromit.timing.com>
Resent-Message-ID: <200707130210.l6D2AFSa032609@freefall.freebsd.org>

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

>Number:         114545
>Category:       ports
>Synopsis:       [patch] for bsd.port.mk to fix linux-xorg-libs ldconfig when using pkg_add -p
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 13 02:10:15 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     John E. Hein
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Symmetricom
>Environment:
System: FreeBSD gromit.timing.com 6.2-STABLE-20070520 FreeBSD 6.2-STABLE-20070520 #5: Mon May 21 08:49:15 MDT 2007 jhein@bugs.timing.com:/usr/obj/usr/src/sys/GROMIT i386


>Description:

The plist for linux-xorg-libs is built with a hard-coded reference
to the build-time linux prefix (/compat/linux by default).

When one uses pkg_add with -p to install the package somewhere other
than it's default location, the linux ldconfig is executed with the
wrong path.


>How-To-Repeat:

Build a chroot.
Install linux_base-fc4 in the chroot.
Note that the linux ldconfig -p output does not include any X libs
as there are none in linux_base-fc4.

chroot /path/to/chroot /compat/linux/sbin/ldconfig -p -r /compat/linux


Outside the chroot, build the linux-xorg-libs package normally

cd x11/linux-xorg-libs
make package

Note that the @exec line in the plist is:
@exec /compat/linux/sbin/ldconfig -r /compat/linux

Add the package into the chroot...
pkg_add -v -p /path/to/chroot linux-xorg-libs-6.8.2_5.tgz

The linux ldconfig -p output _still_ does not include any X libs
because the @exec command is pointing to the wrong place.

chroot /path/to/chroot /compat/linux/sbin/ldconfig -p -r /compat/linux

(observe that there are still no X libs in ldconfig -p output)


>Fix:

Let pkg_add properly replace the prefix by using %D rather than hard-coding
the build-time prefix in the plist.

Index: bsd.port.mk
===================================================================
RCS file: /base/FreeBSD-CVS/ports/Mk/bsd.port.mk,v
retrieving revision 1.574
diff -u -p -r1.574 bsd.port.mk
--- bsd.port.mk	12 Jul 2007 01:57:10 -0000	1.574
+++ bsd.port.mk	13 Jul 2007 00:56:34 -0000
@@ -1486,13 +1486,12 @@ PREFIX?=		${LOCALBASE_REL}
 .if defined(USE_LINUX_PREFIX)
 .if !defined(DESTDIR)
 LDCONFIG_CMD?=			${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL}
-LDCONFIG_PLIST_EXEC_CMD?=	${LDCONFIG_CMD}
 LDCONFIG_PLIST_UNEXEC_CMD?=	${LDCONFIG_CMD}
 .else
 LDCONFIG_CMD?=			${CHROOT} ${DESTDIR} ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL}
-LDCONFIG_PLIST_EXEC_CMD?=	${LDCONFIG_CMD}
 LDCONFIG_PLIST_UNEXEC_CMD?=	${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL}
 .endif
+LDCONFIG_PLIST_EXEC_CMD?=	${LDCONFIG_CMD:C|${LINUXBASE_REL}|%D|g}
 .else
 .if !defined(DESTDIR)
 LDCONFIG_CMD?=			${LDCONFIG} -m ${LDCONFIG_RUNLIST}


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



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