Replace outdated ldconfig-related chapter with one matching reality
(INSTALLS_SHLIB). Reviewed by: ben
This commit is contained in:
parent
30aaf2fe1b
commit
6184009371
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=7977
2 changed files with 74 additions and 60 deletions
|
@ -1,7 +1,7 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/porters-handbook/book.sgml,v 1.120 2000/09/13 13:58:06 ben Exp $
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/porters-handbook/book.sgml,v 1.121 2000/09/17 19:52:35 hoek Exp $
|
||||
-->
|
||||
|
||||
<!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V3.1-Based Extension//EN" [
|
||||
|
@ -1089,39 +1089,46 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract</programlisting>
|
|||
<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>
|
||||
<sect1 id="porting-shlibs">
|
||||
<title>Shared Libraries</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>
|
||||
|
||||
<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 one or more shared libraries, 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. This variable, when defined, will also
|
||||
facilitate addition of an 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 a 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 &man.sed.1; 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 @@ pre-install:
|
|||
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">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/porters-handbook/book.sgml,v 1.120 2000/09/13 13:58:06 ben Exp $
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/porters-handbook/book.sgml,v 1.121 2000/09/17 19:52:35 hoek Exp $
|
||||
-->
|
||||
|
||||
<!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V3.1-Based Extension//EN" [
|
||||
|
@ -1089,39 +1089,46 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract</programlisting>
|
|||
<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>
|
||||
<sect1 id="porting-shlibs">
|
||||
<title>Shared Libraries</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>
|
||||
|
||||
<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 one or more shared libraries, 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. This variable, when defined, will also
|
||||
facilitate addition of an 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 a 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 &man.sed.1; 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 @@ pre-install:
|
|||
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">
|
||||
|
|
Loading…
Reference in a new issue