The Makefile for misc/ldconfig_compat does not respect the $PREFIX env variable when installing this port on freebsd with OSVERSION less than 600101 but greater than 500037, and thus fails to install for non-root users, as shown in the following output: ===== CONSOLE OUTPUT START ===== ===> Installing for ldconfig_compat-1.0_8 ===> Generating temporary packing list ===> Checking if misc/ldconfig_compat already installed Warning: not superuser, you may get some errors during installation. Warning: not superuser, can't run mtree. You may want to become root and try again to ensure correct permissions. install: /etc/rc.d/ldconfig_compat: Permission denied *** Error code 71 Stop in /home/users/whiter/ports/misc/ldconfig_compat. ===== CONSOLE OUTPUT END ===== The error is in the following code in the Makefile: ===== MAKEFILE SNIPPET START ===== do-install: .if ${OSVERSION} >= 600101 @${INSTALL_SCRIPT} ${WRKDIR}/ldconfig_compat.sh ${PREFIX}/etc/rc.d/ldconfig_compat @${ECHO_CMD} "etc/rc.d/ldconfig_compat" >> ${TMPPLIST} .elif ${OSVERSION} >= 500037 @${INSTALL_SCRIPT} ${WRKDIR}/ldconfig_compat.sh /etc/rc.d/ldconfig_compat @${ECHO_CMD} "@cwd /" >> ${TMPPLIST} @${ECHO_CMD} "etc/rc.d/ldconfig_compat" >> ${TMPPLIST} .else @${INSTALL_SCRIPT} ${WRKDIR}/ldconfig_compat.sh ${PREFIX}/etc/rc.d/000.ldconfig_compat.sh @${ECHO_CMD} "etc/rc.d/000.ldconfig_compat.sh" >> ${TMPPLIST} .endif ===== MAKEFILE SNIPPET START ===== As can be seen, $PREFIX is not used when jumping into the ".elif ${OSVERSION} >= 500037" block, resulting in the crash. Fix: Apply the following patch: How-To-Repeat: Set your env to contain everything as pasted below, and do a make install in the mist/ldconfig_compat ports folder. (For more information read the article on ports as non root on my website at http://www.white-russian.nl/?page=/blog/2006/07/installing_free.html ) # Set the main path to include the apps in our homedir PATH=${HOME}/apps/bin:${HOME}/apps/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin; export PATH; # Set the different variables that define where packages are installed LOCALBASE=${HOME}/apps X11BASE=${LOCALBASE} PREFIX=${LOCALBASE} # Set the paths to the folders the ports mechanism works in: WRKDIR=${HOME}/tmp PKG_DBDIR=${LOCALBASE}/var/db/pkg PORT_DBDIR=${LOCALBASE}/var/db/ports DISTDIR=${HOME}/distfiles # Set user and group variables to ourself BINOWN=`whoami` BINGRP=`id -G -n ${BINOWN}` SHAREOWN=${BINOWN} SHAREGRP=${BINGRP} MANOWN=${BINOWN} MANGRP=${BINGRP} # Make sure we don't really try to become root, but just execute everything as ourselves SU_CMD="sh -c" # Make sure that the main ports folder is checked for distfiles first, saving on download time CD_MOUNTPTS=/usr # If distfile found in $CD_MOUNTPTS, symlink to it, instead of copy FETCH_SYMLINK_DISTFILES=YES # Make sure the systemdefault make.conf is not read __MAKE_CONF=${LOCALBASE}/etc/make.conf # Do not try to chown files to root or other users INSTALL_AS_USER=true # Keep our own version of ldconfig hints LDCONFIG="/sbin/ldconfig -i -f ${LOCALBASE}/var/run/ld-elf.so.hints" # Set application specific variables to make sure it doesn't pick up things from the main system APXS=${LOCALBASE}/sbin/apxs PERL=${LOCALBASE}/bin/perl PERL5=${PERL} SITE_PERL=${LOCALBASE}/lib/perl5/site_perl/5.8.8 SITE_PERL5=${SITE_PERL} PERL_VERSION=5.8.8 PERL_VER=${PERL_VERSION}
Responsible Changed From-To: freebsd-ports-bugs->flz Over to maintainer
State Changed From-To: open->closed ldconfig_compat isn't meant to be installed as unprivileged user. Installing the rc.d script in ${PREFIX}/etc/rc.d doesn't make sense here since it's supposed to be run early in the boot sequence. I could make a special case for INSTALL_AS_USER but I don't quite see the point. I'm closing the PR but willing to re-open it eventually.
I suggest reopening this case, because: misc/ldconfig_compat is a dependency for (for example, in my case) the following packages: freetype2-2.2.1_1 lcms-1.15_1,1 libiconv-1.9.2_2 libxml2-2.6.26 mysql-client-5.0.27 p5-DBD-mysql50-3.0003 db42-4.2.52_5 which a non-root user might very well want to install. If misc/ldconfig_compat install fails (like it does now) installation of those other ports is impossible.
State Changed From-To: closed->suspended Re-open, will work on a fix.
State Changed From-To: suspended->analyzed I think USE_LDCONFIG should not depend on ldconfig_compat when INSTALL_AS_USER is defined. I'll send a patch to discuss/fix this.
I think this should fix the issue: http://people.freebsd.org/~flz/local/ports/use-ldconfig-user.diff Basically, if INSTALL_AS_USER is defined, we don't depend on ldconfig_compat and we don't install any file in libdata/ldconfig{,32}. Does this work for you? -- Florent Thoumie flz@FreeBSD.org FreeBSD Committer
Responsible Changed From-To: flz->portmgr Over to portmgr since it's touching bsd.port.mk.
State Changed From-To: analyzed->closed flz's patch was committed
pav 2007-10-03 22:25:00 UTC FreeBSD ports repository Modified files: Mk bsd.port.mk bsd.xorg.mk Log: - Fix issues with actual-package-depends, most notably fix bad list when a third party package with invalid or missing pkgorigin is installed; this resulted in silently discarding dependency records for some people PR: ports/115010 Submitted by: netchild - Replace some calls to basename and dirname with make logic PR: ports/115994 Submitted by: netchild - Fix bsd.xorg.mk to work when USE_XORG is used below .include <bsd.port.pre.mk>; should allow conditional X.Org component dependencies with OPTIONS, etc Submitted by: flz - When installing as user, don't install any libdata/ldconfig entries Submitted by: flz PR: ports/106613 (in audit trail) - Introduce INSTALL_KLD; it's same as INSTALL_SCRIPT but the name is more obvious PR: ports/116200 Submitted by: edwin Revision Changes Path 1.588 +44 -26 ports/Mk/bsd.port.mk 1.4 +11 -5 ports/Mk/bsd.xorg.mk _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"