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
|
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" [
|
<!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
|
<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>
|
create a port. This section explains the most common of those.</para>
|
||||||
|
|
||||||
<sect1 id="porting-ldconfig">
|
<sect1 id="porting-shlibs">
|
||||||
<title><command>ldconfig</command></title>
|
<title>Shared Libraries</title>
|
||||||
|
|
||||||
<para>If your port installs a shared library, add a
|
<para>If your port installs one or more shared libraries, define a
|
||||||
<maketarget>post-install</maketarget> target to your
|
<makevar>INSTALLS_SHLIB</makevar> make variable, which will instruct
|
||||||
<filename>Makefile</filename> that runs <literal>${LDCONFIG}
|
a <filename>bsd.port.mk</filename> to run
|
||||||
-m</literal> on the directory where the new library is installed
|
<literal>${LDCONFIG} -m</literal> on the directory where the
|
||||||
(usually <filename><makevar>PREFIX</makevar>/lib</filename>) to
|
new library is installed (usually
|
||||||
register it into the shared library cache.</para>
|
<filename><makevar>PREFIX</makevar>/lib</filename>) during
|
||||||
|
<maketarget>post-install</maketarget> target to register it into the
|
||||||
<para>Also, add a matching <literal>@exec /sbin/ldconfig -m</literal>
|
shared library cache. This variable, when defined, will also
|
||||||
and <literal>@unexec /sbin/ldconfig -R</literal> pair to your
|
facilitate addition of an appropriate
|
||||||
<filename>pkg/PLIST</filename> file so that a user who installed the
|
<literal>@exec /sbin/ldconfig -m</literal> and
|
||||||
package can start using the shared library immediately 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
|
deinstallation will not cause the system to still believe the
|
||||||
library is there. These lines should immediately follow the line
|
library is there.</para>
|
||||||
for the shared library itself, as in:</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>
|
<programlisting>
|
||||||
lib/libtvl80.so.1
|
INSTALLS_SHLIB= yes
|
||||||
@exec /sbin/ldconfig -m %D/lib
|
LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
|
||||||
@unexec /sbin/ldconfig -R</programlisting>
|
|
||||||
|
|
||||||
<para>Never, ever, <emphasis>ever</emphasis> add a line that says
|
<para>Note that content of <makevar>LDCONFIG_DIRS</makevar> is passed
|
||||||
<literal>ldconfig</literal> without any arguments to your
|
through &man.sed.1; just like the rest of <filename>pkg/PLIST</filename>,
|
||||||
<filename>Makefile</filename> or <filename>pkg/PLIST</filename>.
|
so <makevar>PLIST_SUB</makevar> substitutions also apply here. It is
|
||||||
This will reset the shared library cache to the contents of
|
recommended that you use <literal>%%PREFIX%%</literal> for
|
||||||
<filename>/usr/lib</filename> only, and will royally screw up the
|
<makevar>PREFIX</makevar>, <literal>%%LOCALBASE%%</literal> for
|
||||||
user's machine ("Help, xinit does not run anymore after I install
|
<makevar>LOCALBASE</makevar> and <literal>%%X11BASE%%</literal> for
|
||||||
this port!"). Anybody who does this will be shot and cut in 65,536
|
<makevar>X11BASE</makevar>.</para>
|
||||||
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>
|
|
||||||
</sect1>
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
|
@ -3387,7 +3394,7 @@ pre-install:
|
||||||
be added as noted in the <link linkend="porting-info">info
|
be added as noted in the <link linkend="porting-info">info
|
||||||
files</link> section. Any
|
files</link> section. Any
|
||||||
libraries installed by the port should be listed as specified in the
|
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>
|
||||||
|
|
||||||
<chapter id="porting-pkgname">
|
<chapter id="porting-pkgname">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!--
|
<!--
|
||||||
The FreeBSD Documentation Project
|
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" [
|
<!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
|
<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>
|
create a port. This section explains the most common of those.</para>
|
||||||
|
|
||||||
<sect1 id="porting-ldconfig">
|
<sect1 id="porting-shlibs">
|
||||||
<title><command>ldconfig</command></title>
|
<title>Shared Libraries</title>
|
||||||
|
|
||||||
<para>If your port installs a shared library, add a
|
<para>If your port installs one or more shared libraries, define a
|
||||||
<maketarget>post-install</maketarget> target to your
|
<makevar>INSTALLS_SHLIB</makevar> make variable, which will instruct
|
||||||
<filename>Makefile</filename> that runs <literal>${LDCONFIG}
|
a <filename>bsd.port.mk</filename> to run
|
||||||
-m</literal> on the directory where the new library is installed
|
<literal>${LDCONFIG} -m</literal> on the directory where the
|
||||||
(usually <filename><makevar>PREFIX</makevar>/lib</filename>) to
|
new library is installed (usually
|
||||||
register it into the shared library cache.</para>
|
<filename><makevar>PREFIX</makevar>/lib</filename>) during
|
||||||
|
<maketarget>post-install</maketarget> target to register it into the
|
||||||
<para>Also, add a matching <literal>@exec /sbin/ldconfig -m</literal>
|
shared library cache. This variable, when defined, will also
|
||||||
and <literal>@unexec /sbin/ldconfig -R</literal> pair to your
|
facilitate addition of an appropriate
|
||||||
<filename>pkg/PLIST</filename> file so that a user who installed the
|
<literal>@exec /sbin/ldconfig -m</literal> and
|
||||||
package can start using the shared library immediately 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
|
deinstallation will not cause the system to still believe the
|
||||||
library is there. These lines should immediately follow the line
|
library is there.</para>
|
||||||
for the shared library itself, as in:</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>
|
<programlisting>
|
||||||
lib/libtvl80.so.1
|
INSTALLS_SHLIB= yes
|
||||||
@exec /sbin/ldconfig -m %D/lib
|
LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
|
||||||
@unexec /sbin/ldconfig -R</programlisting>
|
|
||||||
|
|
||||||
<para>Never, ever, <emphasis>ever</emphasis> add a line that says
|
<para>Note that content of <makevar>LDCONFIG_DIRS</makevar> is passed
|
||||||
<literal>ldconfig</literal> without any arguments to your
|
through &man.sed.1; just like the rest of <filename>pkg/PLIST</filename>,
|
||||||
<filename>Makefile</filename> or <filename>pkg/PLIST</filename>.
|
so <makevar>PLIST_SUB</makevar> substitutions also apply here. It is
|
||||||
This will reset the shared library cache to the contents of
|
recommended that you use <literal>%%PREFIX%%</literal> for
|
||||||
<filename>/usr/lib</filename> only, and will royally screw up the
|
<makevar>PREFIX</makevar>, <literal>%%LOCALBASE%%</literal> for
|
||||||
user's machine ("Help, xinit does not run anymore after I install
|
<makevar>LOCALBASE</makevar> and <literal>%%X11BASE%%</literal> for
|
||||||
this port!"). Anybody who does this will be shot and cut in 65,536
|
<makevar>X11BASE</makevar>.</para>
|
||||||
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>
|
|
||||||
</sect1>
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
|
@ -3387,7 +3394,7 @@ pre-install:
|
||||||
be added as noted in the <link linkend="porting-info">info
|
be added as noted in the <link linkend="porting-info">info
|
||||||
files</link> section. Any
|
files</link> section. Any
|
||||||
libraries installed by the port should be listed as specified in the
|
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>
|
||||||
|
|
||||||
<chapter id="porting-pkgname">
|
<chapter id="porting-pkgname">
|
||||||
|
|
Loading…
Reference in a new issue