- <sect1 id="symbols-paths">
- <heading>The <file>symbols</file> files present on the
- system</heading>
-
- <p>
- <file>symbols</file> files for a shared library are normally
- provided by the shared library package, but there are several
- override paths that are checked first in case that information
- is wrong or missing. The following list gives them in the
- order in which they are read by <prgn>dpkg-shlibdeps</prgn>
- The first one that contains the required information is used.
- <list>
- <item>
- <p><file>debian/*/DEBIAN/symbols</file></p>
-
- <p>
- During the package build, if the package itself contains
- shared libraries with <file>symbols</file> files, they
- will be generated in these staging directories
- by <prgn>dpkg-gensymbols</prgn>. <file>symbols</file>
- files found in the build tree take precedence
- over <file>symbols</file> files from other binary
- packages.
- </p>
-
- <p>
- These files must exist
- before <prgn>dpkg-shlibdeps</prgn> is run or the
- dependencies of binaries and libraries from a source
- package on other libraries from that same source package
- will not be correct. In practice, this means
- that <prgn>dpkg-gensymbols</prgn> must be run
- before <prgn>dpkg-shlibdeps</prgn> during the package
- build.<footnote>
- An example may clarify. Suppose the source
- package <tt>foo</tt> generates two binary
- packages, <tt>libfoo2</tt> and <tt>foo-runtime</tt>.
- When building the binary packages, the contents of the
- packages are staged in the
- directories <file>debian/libfoo2</file>
- and <file>debian/foo-runtime</file> respectively.
- (<file>debian/tmp</file> could be used instead of one
- of these.) Since <tt>libfoo2</tt> provides
- the <tt>libfoo</tt> shared library, it will contain
- a <tt>symbols</tt> file, which will be installed
- in <file>debian/libfoo2/DEBIAN/symbols</file>,
- eventually to be included as a control file in that
- package. When <prgn>dpkg-shlibdeps</prgn> is run on
- the
- executable <file>debian/foo-runtime/usr/bin/foo-prog</file>,
- it will examine
- the <file>debian/libfoo2/DEBIAN/symbols</file> file to
- determine whether <tt>foo-prog</tt>'s library
- dependencies are satisfied by any of the libraries
- provided by <tt>libfoo2</tt>. Since those binaries
- were linked against the just-built shared library as
- part of the build process, the <file>symbols</file>
- file for the newly-built <tt>libfoo2</tt> must take
- precedence over a <file>symbols</file> file for any
- other <tt>libfoo2</tt> package already installed on
- the system.
- </footnote>
- </p>
- </item>
-
- <item>
- <p>
- <file>/etc/dpkg/symbols/<var>package</var>.symbols.<var>arch</var></file>
- and <file>/etc/dpkg/symbols/<var>package</var>.symbols</file>
- </p>
-
- <p>
- Per-system overrides of shared library dependencies.
- These files normally do not exist. They are maintained
- by the local system administrator and must not be
- created by any Debian package.
- </p>
- </item>
-
- <item>
- <p><file>symbols</file> control files for packages
- installed on the system</p>
-
- <p>
- The <file>symbols</file> control files for all the
- packages currently installed on the system are searched
- last. This will be the most common source of shared
- library dependency information. These are normally
- found in <file>/var/lib/dpkg/info/*.symbols</file>, but
- packages should not rely on this and instead should
- use <tt>dpkg-query --control-path <var>package</var>
- symbols</tt> if for some reason these files need to be
- examined.
- </p>
- </item>
- </list>
- </p>
-
- <p>
- Be aware that if a <file>debian/shlibs.local</file> exists in
- the source package, it will override any <file>symbols</file>
- files. This is the only case where a <file>shlibs</file> is
- used despite <file>symbols</file> files being present. See
- <ref id="shlibs-paths"> and <ref id="sharedlibs-shlibdeps">
- for more information.
- </p>
- </sect1>
-