From owner-freebsd-doc Tue Sep 19 7:48:48 2000 Delivered-To: freebsd-doc@freebsd.org Received: from blizzard.sabbo.net (blizzard.sabbo.net [193.193.218.18]) by hub.freebsd.org (Postfix) with ESMTP id 415D137B423; Tue, 19 Sep 2000 07:48:32 -0700 (PDT) Received: from vic.sabbo.net (root@vic.sabbo.net [193.193.218.109]) by blizzard.sabbo.net (8.9.1/8.9.3) with ESMTP id RAA05369; Tue, 19 Sep 2000 17:48:21 +0300 (EEST) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vic.sabbo.net (8.11.0/8.9.3) with ESMTP id e8JEmMS05330; Tue, 19 Sep 2000 17:48:22 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <39C77CA9.8AED84CA@FreeBSD.org> Date: Tue, 19 Sep 2000 17:48:09 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: uk,ru,en MIME-Version: 1.0 To: doc@FreeBSD.org, ports@FreeBSD.org Subject: Porter's Handbook patch Content-Type: multipart/mixed; boundary="------------AE7302D1A9E4EF4E25D5C3B5" Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------AE7302D1A9E4EF4E25D5C3B5 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Dear -doc and -ports people, Please review attached patch, which intended to replace outdated ldconfig-related chapter in Porter's Handbook with one matching reality (INSTALLS_SHLIB). -Maxim --------------AE7302D1A9E4EF4E25D5C3B5 Content-Type: text/html; charset=koi8-r; name="ph.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ph.diff" Index: book.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO_8859-1/books/porters-handbook/book.sgml,v retrieving revision 1.121 diff -d -u -r1.121 book.sgml --- book.sgml 2000/09/17 19:52:35 1.121 +++ book.sgml 2000/09/19 14:45:32 @@ -1089,39 +1089,46 @@ There are some more things you have to take into account when you create a port. This section explains the most common of those. - - <command>ldconfig</command> - - If your port installs a shared library, add a - post-install target to your - Makefile that runs ${LDCONFIG} - -m on the directory where the new library is installed - (usually PREFIX/lib) to - register it into the shared library cache. + + Shared Libraries - Also, add a matching @exec /sbin/ldconfig -m - and @unexec /sbin/ldconfig -R pair to your - pkg/PLIST file so that a user who installed the - package can start using the shared library immediately and + If your port installs a shared library(ies), define a + INSTALLS_SHLIB make variable, which will instruct + a bsd.port.mk to run + ${LDCONFIG} -m on the directory where the + new library is installed (usually + PREFIX/lib) during + post-install target to register it into the + shared library cache. Also this variable, when defined, will + facilitate addition a appropriate + @exec /sbin/ldconfig -m and + @unexec /sbin/ldconfig -R pair into your + pkg/PLIST file, so that a user who installed + the package can start using the shared library immediately and deinstallation will not cause the system to still believe the - library is there. These lines should immediately follow the line - for the shared library itself, as in: + library is there. + If you need, you can override default location where the new + library is installed by defining LDCONFIG_DIRS + make variable, which should contain list of directories into which + shared libraries are to be installed. For example if your port + installs shared libraries into + PREFIX/lib/foo and + PREFIX/lib/bar directories + you could use the following in your + Makefile: + -lib/libtvl80.so.1 -@exec /sbin/ldconfig -m %D/lib -@unexec /sbin/ldconfig -R +INSTALLS_SHLIB= yes +LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar - Never, ever, ever add a line that says - ldconfig without any arguments to your - Makefile or pkg/PLIST. - This will reset the shared library cache to the contents of - /usr/lib only, and will royally screw up the - user's machine ("Help, xinit does not run anymore after I install - this port!"). Anybody who does this will be shot and cut in 65,536 - pieces by a rusty knife and have his liver chopped out by a bunch of - crows and will eternally rot to death in the deepest bowels of hell - (not necessarily in that order…) + Note that content of LDCONFIG_DIRS is passed + through sed just like the rest of pkg/PLIST, + so PLIST_SUB substitutions also apply here. It is + recommended that you use %%PREFIX%% for + PREFIX, %%LOCALBASE%% for + LOCALBASE and %%X11BASE%% for + X11BASE. @@ -3387,7 +3394,7 @@ be added as noted in the info files section. Any libraries installed by the port should be listed as specified in the - ldconfig section. + shared libraries section. --------------AE7302D1A9E4EF4E25D5C3B5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message