From owner-freebsd-current@FreeBSD.ORG Sun Aug 31 07:52:59 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9901216A4BF; Sun, 31 Aug 2003 07:52:59 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00F9C43FCB; Sun, 31 Aug 2003 07:52:43 -0700 (PDT) (envelope-from ru@sunbay.com) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) h7VEqQ86033227 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Aug 2003 17:52:27 +0300 (EEST) (envelope-from ru@sunbay.com) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.9/8.12.8/Submit) id h7VEqOPM033212; Sun, 31 Aug 2003 17:52:24 +0300 (EEST) (envelope-from ru) Date: Sun, 31 Aug 2003 17:52:24 +0300 From: Ruslan Ermilov To: Alexander Leidinger Message-ID: <20030831145224.GC28845@sunbay.com> References: <200308291454.h7TEsb913915@accms33.physik.rwth-aachen.de> <20030829172348.1aa0b5d4.Alexander@Leidinger.net> <20030829161907.GA89129@troutmask.apl.washington.edu> <20030830135427.0cea7fdb.Alexander@Leidinger.net> <20030830185653.GA10674@sunbay.com> <20030831140742.3bd1b597.Alexander@Leidinger.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WChQLJJJfbwij+9x" Content-Disposition: inline In-Reply-To: <20030831140742.3bd1b597.Alexander@Leidinger.net> User-Agent: Mutt/1.5.4i cc: Gordon Tetlow cc: Christoph Kukulies cc: current@FreeBSD.org cc: Steve Kargl Subject: Re: /lib symlinks problem? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2003 14:52:59 -0000 --WChQLJJJfbwij+9x Content-Type: multipart/mixed; boundary="2/5bycvrmDh4d1IB" Content-Disposition: inline --2/5bycvrmDh4d1IB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 31, 2003 at 02:07:42PM +0200, Alexander Leidinger wrote: > On Sat, 30 Aug 2003 21:56:53 +0300 > Ruslan Ermilov wrote: >=20 > > > I think a workaround would be to use absolute symlinks (at least as an > > > option). > > >=20 > > I might be missing an obvious, but I just don't see a reason > > why we should use relative linking here: we should just link > > to where we really install. With the attached patch, I get: > >=20 > > $ make -n install -DNOMAN DESTDIR=3D/foo > > install -C -o root -g wheel -m 444 libalias.a /foo/usr/lib > > install -s -o root -g wheel -m 444 libalias.so.4 /foo/lib > > ln -fs libalias.so.4 /foo/lib/libalias.so > > ln -fs /foo/lib/libalias.so.4 /foo/usr/lib/libalias.so >=20 > Don't you have to remove the first ${DESTDIR} to make this work in the > "put a harddisk into a running system and install a system via > installworld & distribute" case? >=20 Doh, you're of course right! An updated patch is attached. Now it looks like this: install -C -o root -g wheel -m 444 libalias.a /foo/usr/lib install -s -o root -g wheel -m 444 libalias.so.4 /foo/lib ln -fs libalias.so.4 /foo/lib/libalias.so ln -fs /lib/libalias.so.4 /foo/usr/lib/libalias.so This is also consistent with how we handle SYMLINKS: # make -f bsd.prog.mk BINDIR=3D/bin SYMLINKS=3D'${BINDIR}/file1 ${BINDIR}/f= ile2' install DESTDIR=3D/foo /foo/bin/file2 -> /bin/file1 # ls -l /foo/bin total 0 lrwxr-xr-x 1 root wheel 10 Aug 31 17:44 file2 -> /bin/file1 Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software Ltd, ru@FreeBSD.org FreeBSD committer --2/5bycvrmDh4d1IB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: bsd.lib.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.lib.mk,v retrieving revision 1.150 diff -u -r1.150 bsd.lib.mk --- bsd.lib.mk 17 Aug 2003 23:56:29 -0000 1.150 +++ bsd.lib.mk 31 Aug 2003 14:46:32 -0000 @@ -207,9 +207,8 @@ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} .if defined(SHLIB_LINK) ln -fs ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK} -.if (${LIBDIR} != ${SHLIBDIR}) - ln -fs ${LIBDIR:C|/[^/]+|/..|g:S|^/||}${SHLIBDIR}/${SHLIB_NAME} \ - ${DESTDIR}${LIBDIR}/${SHLIB_LINK} +.if ${LIBDIR} != ${SHLIBDIR} + ln -fs ${SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} .endif .endif .endif --2/5bycvrmDh4d1IB-- --WChQLJJJfbwij+9x Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE/UguoUkv4P6juNwoRAjwsAKCFnzwG0CE+apJ3u1U7zQKkb9Do7QCfRi7G a4QJGGrGCzoGDjUAbHiQzCg= =rNBv -----END PGP SIGNATURE----- --WChQLJJJfbwij+9x--