53
Chapter 8
Shared libraries
Packages containing shared libraries must be constructed with a little care to make sure that
the shared library is always available. This is especially important for packages whose shared
libraries are vitally important, such as the C library (currently
libc6
).
Packages involving shared libraries should be split up into several binary packages. This sec
tion mostly deals with how this separation is to be accomplished; rules for files within the
shared library packages are in `Libraries' on page
78
instead.
8.1 Run time shared libraries
The run time shared library needs to be placed in a package whose name changes when
ever the shared object version changes.
1
The most common mechanism is to place it in
a package called
librarynamesoversion
, where
soversion
is the version number in
the soname of the shared library
2
. Alternatively, if it would be confusing to directly ap
pend soversion to libraryname (e.g. because libraryname itself ends in a number), you may use
libraryname
soversion
and
libraryname
soversion
dev
instead.
If your package includes run time support programs that do not need to be invoked manually
by users, but are nevertheless required for the package to function, then it is recommended that
these programs are placed (if they are binary) in a subdirectory of
/usr/lib
, preferably under
/usr/lib/
package name. If the program is architecture independent, the recommendation is
for it to be placed in a subdirectory of
/usr/share
instead, preferably under
/usr/share
/
package name.
If you have several shared libraries built from the same source tree you may lump them all
together into a single shared library package, provided that you change all of their sonames
1
Since it is common place to install several versions of a package that just provides shared libraries, it is a good
idea that that the library package should not contain any extraneous non versioned files, unless they happen to be
in versioned directories.
2
The soname is the shared object name: it's the thing that has to match exactly between building an executable
and running it for the dynamic linker to be able run the program. For example, if the soname of the library is
libfoo.so.6
, the library package would be called
libfoo6
.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved