Date: Tue, 19 Sep 2000 17:48:09 +0300 From: Maxim Sobolev <sobomax@FreeBSD.org> To: doc@FreeBSD.org, ports@FreeBSD.org Subject: Porter's Handbook patch Message-ID: <39C77CA9.8AED84CA@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
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 @@ <para>There are some more things you have to take into account when you create a port. This section explains the most common of those.</para> - <sect1 id="porting-ldconfig"> - <title><command>ldconfig</command></title> - - <para>If your port installs a shared library, add a - <maketarget>post-install</maketarget> target to your - <filename>Makefile</filename> that runs <literal>${LDCONFIG} - -m</literal> on the directory where the new library is installed - (usually <filename><makevar>PREFIX</makevar>/lib</filename>) to - register it into the shared library cache.</para> + <sect1 id="porting-shlibs"> + <title>Shared Libraries</title> - <para>Also, add a matching <literal>@exec /sbin/ldconfig -m</literal> - and <literal>@unexec /sbin/ldconfig -R</literal> pair to your - <filename>pkg/PLIST</filename> file so that a user who installed the - package can start using the shared library immediately and + <para>If your port installs a shared library(ies), define a + <makevar>INSTALLS_SHLIB</makevar> make variable, which will instruct + a <filename>bsd.port.mk</filename> to run + <literal>${LDCONFIG} -m</literal> on the directory where the + new library is installed (usually + <filename><makevar>PREFIX</makevar>/lib</filename>) during + <maketarget>post-install</maketarget> target to register it into the + shared library cache. Also this variable, when defined, will + facilitate addition a appropriate + <literal>@exec /sbin/ldconfig -m</literal> and + <literal>@unexec /sbin/ldconfig -R</literal> pair into your + <filename>pkg/PLIST</filename> 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:</para> + library is there.</para> + <para>If you need, you can override default location where the new + library is installed by defining <makevar>LDCONFIG_DIRS</makevar> + 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 + <filename><makevar>PREFIX</makevar>/lib/foo</filename> and + <filename><makevar>PREFIX</makevar>/lib/bar</filename> directories + you could use the following in your + <filename>Makefile</filename>:</para> + <programlisting> -lib/libtvl80.so.1 -@exec /sbin/ldconfig -m %D/lib -@unexec /sbin/ldconfig -R</programlisting> +INSTALLS_SHLIB= yes +LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting> - <para>Never, ever, <emphasis>ever</emphasis> add a line that says - <literal>ldconfig</literal> without any arguments to your - <filename>Makefile</filename> or <filename>pkg/PLIST</filename>. - This will reset the shared library cache to the contents of - <filename>/usr/lib</filename> 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…)</para> + <para>Note that content of <makevar>LDCONFIG_DIRS</makevar> is passed + through sed just like the rest of <filename>pkg/PLIST</filename>, + so <makevar>PLIST_SUB</makevar> substitutions also apply here. It is + recommended that you use <literal>%%PREFIX%%</literal> for + <makevar>PREFIX</makevar>, <literal>%%LOCALBASE%%</literal> for + <makevar>LOCALBASE</makevar> and <literal>%%X11BASE%%</literal> for + <makevar>X11BASE</makevar>.</para> </sect1> </chapter> @@ -3387,7 +3394,7 @@ be added as noted in the <link linkend="porting-info">info files</link> section. Any libraries installed by the port should be listed as specified in the - <link linkend="porting-ldconfig">ldconfig</link> section.</para> + <link linkend="porting-shlibs">shared libraries</link> section.</para> </chapter> <chapter id="porting-pkgname"> --------------AE7302D1A9E4EF4E25D5C3B5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39C77CA9.8AED84CA>