.TH dpkg\-shlibdeps 1 "2007-07-16" "Debian Project" "dpkg utilities" .SH NAME dpkg\-shlibdeps \- generate shared library substvar dependencies . .SH SYNOPSIS .B dpkg\-shlibdeps .RI [ options ] .IR executable | \fB-e\fPexecutable .RI [ options ] . .SH DESCRIPTION .B dpkg\-shlibdeps calculates shared library dependencies for executables named in its arguments. The dependencies are added to the substitution variables file .B debian/substvars as variable names .BI shlibs: dependencyfield where .I dependencyfield is a dependency field name. Any other variables starting .I shlibs: are removed from the file. .P .B dpkg\-shlibdeps has two possible sources of information to generate dependency information. Either .I symbols files or .I shlibs files. For each binary that .B dpkg\-shlibdeps analyzes, it finds out the list of libraries that it's linked with. Then, for each library, it looks up either the .I symbols file, or the .I shlibs file (if the former doesn't exist). Both files are supposed to be provided by the library package and should thus be available as /var/lib/dpkg/info/\fIpackage\fR.\fIsymbols\fR or /var/lib/dpkg/info/\fIpackage\fR.\fIshlibs\fR. The package name is identified in two steps: find the library file on the system (looking in the same directories that \fBld.so\fR would use), then use .BI "dpkg -S " library\-file to lookup the package providing the library. .SS Symbols files Symbols files contain finer-grained dependency information by providing the minimum dependency for each symbol that the library exports. The script tries to find a symbols file associated to a library package in the following places (first match is used): .IP debian/*/DEBIAN/symbols Shared library information generated by the current build process that also invoked .BR dpkg\-shlibdeps . They are generated by .BR dpkg\-gensymbols (1). .IP /etc/dpkg/symbols/\fIpackage\fR.symbols.\fIarch\fR .IP /etc/dpkg/symbols/\fIpackage\fR.symbols Per-system overriding shared library dependency information. \fIarch\fR is the architecture of the current system (obtained by .BR "dpkg-architecture -qDEB_HOST_ARCH" ). .IP \fIadmindir\fR/info/\fIpackage\fR.symbols Package-provided shared library dependency information. Unless overriden, \fIadmindir\fR is /var/lib/dpkg. .P While scanning the symbols used by all binaries, .B dpkg\-shlibdeps remembers the (biggest) minimal version needed for each library. At the end of the process, it is able to write out the minimal dependency for every library used (provided that the information of the \fIsymbols\fR files are accurate). .SS Shlibs files Shlibs files associate directly a library to a dependency (without looking at the symbols). It's thus often stronger than really needed but very safe and easy to handle. .P The dependencies for a library are looked up in several places. The first file providing informations for the library of interest is used: .IP debian/shlibs.local Package-local overriding shared library dependency information. .IP /etc/dpkg/shlibs.override Per-system overriding shared library dependency information. .IP debian/*/DEBIAN/shlibs Shared library information generated by the current build process that also invoked .BR dpkg\-shlibdeps . .IP \fIadmindir\fR/info/\fIpackage\fR.shlibs Package-provided shared library dependency information. Unless overriden, \fIadmindir\fR is /var/lib/dpkg. .IP /etc/dpkg/shlibs.default Per-system default shared library dependency information. .P The extracted dependencies are then directly used (except if they are filtered out because they have been identified as duplicate, or as weaker than another dependency). .SH OPTIONS .B dpkg\-shlibdeps interprets non-option arguments as executable names, just as if they'd been supplied as .BI \-e executable\fR. .TP .BI \-e executable Include dependencies appropriate for the shared libraries required by .IR executable . .TP .BI \-d dependencyfield Add dependencies to be added to the control file dependency field .IR dependencyfield . (The dependencies for this field are placed in the variable .BI shlibs: dependencyfield\fR.) The .BI \-d dependencyfield option takes effect for all executables after the option, until the next .BI \-d dependencyfield\fR. The default .I dependencyfield is .BR Depends . If the same dependency entry (or set of alternatives) appears in more than one of the recognised dependency field names .BR Pre\-Depends ", " Depends ", " Recommends ", " Enhances " or " Suggests then .B dpkg\-shlibdeps will automatically remove the dependency from all fields except the one representing the most important dependencies. .TP .BI \-p varnameprefix Start substitution variables with .IB varnameprefix : instead of .BR shlibs: . Likewise, any existing substitution variables starting with .IB varnameprefix : (rather than .BR shlibs: ) are removed from the the substitution variables file. .TP .B \-O Print substitution variable settings to standard output, rather than being added to the substitution variables file .RB ( debian/substvars by default). .TP .BI \-t type Prefer shared library dependency information tagged for the given package type. If no tagged information is available, falls back to untagged information. The default package type is "deb". Shared library dependency information is tagged for a given type by prefixing it with the name of the type, a colon, and whitespace. .TP .BI \-L localshlibsfile Read overriding shared library dependency information from .I localshlibsfile instead of .BR debian/shlibs.local . .TP .BI \-T substvarsfile Write substitution variables in .IR substvarsfile ; the default is .BR debian/substvars . .TP .BI \-v Enable verbose mode. Numerous messages are displayed to explain what .B dpkg\-shlibdeps does. .TP .BI \-x package Exclude the package from the generated dependencies. This is useful to avoid self-dependencies for packages which provide ELF binaries (executables or library plugins) using a library contained in the same package. This option can be used multiple times to exclude several packages. .TP .BI \-\-ignore\-missing\-info Do not fail if dependency information can't be found for a shared library. Usage of this option is discouraged, all libraries should provide dependency information (either with shlibs files, or with symbols files) even if they are not yet used by other packages. .TP .BI \-\-admindir= dir Change the location of the \fBdpkg\fR database. The default location is \fI/var/lib/dpkg\fP. .TP .BR \-h ", " \-\-help Show the usage message and exit. .TP .BR \-\-version Show the version and exit. . .SH WARNINGS Since .B dpkg\-shlibdeps analyzes the set of symbols used by each binary of the generated package, it is able to emit warnings in several cases. They inform you of things that can be improved in the package. In most cases, those improvements concern the upstream sources directly. By order of decreasing importance, here are the various warnings that you can encounter: .TP .BI symbol " sym" " used by " binary " found in none of the libraries." The indicated symbol has not been found in the libraries linked with the binary. The \fIbinary\fR is most likely a library and it needs to be linked with an additional library during the build process (option \fB-l\fR\fIlibrary\fR of the linker). .TP .IB binary " shouldn't be linked with " library " (it uses none of its symbols)." The \fIbinary\fR is linked to a library that it doesn't need. It's not a problem but some small performance improvements in binary load time can be obtained by not linking this library to this binary. Furthermore, in some cases, this will lead to a non-versionned dependency on the library that could have been avoided if the binary was only linked against the library that it really uses. The exception to this rule is when several binaries are linked against the same set of libraries but each binary only uses a subset of those. You will have warnings on individual binaries, but the set of libraries needed at the package level is the same whether you fix the binaries or not. .SH "SEE ALSO" .BR deb\-shlibs (5), .BR deb\-symbols (5), .BR dpkg-gensymbols (1). . .SH AUTHORS Copyright (C) 1995-1996 Ian Jackson .br Copyright (C) 2000 Wichert Akkerman .br Copyright (C) 2006 Frank Lichtenheld .br Copyright (C) 2007 Rapha\[:e]l Hertzog .sp This is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO WARRANTY.