diff --git a/en_US.ISO8859-1/books/porters-handbook/book.sgml b/en_US.ISO8859-1/books/porters-handbook/book.sgml index e7965ba53b..c61020498c 100644 --- a/en_US.ISO8859-1/books/porters-handbook/book.sgml +++ b/en_US.ISO8859-1/books/porters-handbook/book.sgml @@ -1,7 +1,7 @@ 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> + + Shared Libraries - 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. - - 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 one or more shared libraries, 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. This variable, when defined, will also + facilitate addition of an 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 a 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 &man.sed.1; 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 @@ pre-install: 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. diff --git a/en_US.ISO_8859-1/books/porters-handbook/book.sgml b/en_US.ISO_8859-1/books/porters-handbook/book.sgml index e7965ba53b..c61020498c 100644 --- a/en_US.ISO_8859-1/books/porters-handbook/book.sgml +++ b/en_US.ISO_8859-1/books/porters-handbook/book.sgml @@ -1,7 +1,7 @@ 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> + + Shared Libraries - 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. - - 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 one or more shared libraries, 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. This variable, when defined, will also + facilitate addition of an 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 a 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 &man.sed.1; 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 @@ pre-install: 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.