Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jun 2006 15:43:20 +0200 (CEST)
From:      Gerald Pfeifer <gerald@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        flz@FreeBSD.org
Subject:   ports/99370: USE_LDCONFIG fails installation for non-default prefix
Message-ID:  <200606231343.k5NDhK2e069161@nibal.dbai.tuwien.ac.at>
Resent-Message-ID: <200606231350.k5NDoGU1060882@freefall.freebsd.org>

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

>Number:         99370
>Category:       ports
>Synopsis:       USE_LDCONFIG fails installation for non-default prefix
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 23 13:50:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Gerald Pfeifer
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
	Current Ports Collection.
>Description:
	I converted some of my ports, notably emulators/wine and
	lang/gcc40 to use the nice new USE_LDCONFIG facility, but
	now found that installation into a non-default prefix fails
	when trying to write ${PREFIX}/${LDCONFIG_DIR}/${UNIQUENAME}
	since ${PREFIX}/${LDCONFIG_DIR} does not exist.

	(I had tested this before updating the ports, and successfully,
	so I'm not sure what made the difference.)

	Looking at the code, the problem is easy to spot:

.if ${USE_LDCONFIG:L} != "${PREFIX}/lib"
    @${ECHO_MSG} "===>   Installing ldconfig configuration file"
    @${MKDIR} ${PREFIX}/${LDCONFIG_DIR}
    @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
        > ${PREFIX}/${LDCONFIG_DIR}/${UNIQUENAME}
    @${ECHO_CMD} ${LDCONFIG_DIR}/${UNIQUENAME} >> ${TMPPLIST}
.endif

>How-To-Repeat:
	I avoided this by adding the following to my ports:

post-install:
        -@${MKDIR} ${PREFIX}/libdata/ldconfig

>Fix:

	The real fix may look like the following:

Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.534
diff -u -3 -p -r1.534 bsd.port.mk
--- bsd.port.mk	16 Jun 2006 04:53:43 -0000	1.534
+++ bsd.port.mk	23 Jun 2006 13:36:32 -0000
@@ -3663,6 +3663,7 @@ install-ldconfig-file:
 .endif
 .if ${USE_LDCONFIG:L} != "${PREFIX}/lib"
 	@${ECHO_MSG} "===>   Installing ldconfig configuration file"
+	@${MKDIR} ${PREFIX}/${LDCONFIG_DIR}
 	@${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
 		> ${PREFIX}/${LDCONFIG_DIR}/${UNIQUENAME}
 	@${ECHO_CMD} ${LDCONFIG_DIR}/${UNIQUENAME} >> ${TMPPLIST}
>Release-Note:
>Audit-Trail:
>Unformatted:



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