[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shared libs dependencies



Ole Streicher <debian-devel@liska.ath.cx> writes:

> First of all: what is the difference between the "Depends" field in the
> control file and the "shlibs" file? Should they contain the same
> (library) dependencies?

shlibs will be used when packages linking against your lib get built,
and the contents of it will be used for building the ${shlibs:Depends}
of that package.

Or, to put it in other words: Depends lists the packages your library
depends on, shlibs lists the libs that packages built against your lib
should depend on.

> My source package (wcslib) will create a shared library package
> "libwcs4" and a tools package "wcslib-tools" (and others). So, since I
> have multiple binary pkgs, I should (according to the manual) create a
> file "debian/shlibs.libwcs4" containing the library that libwcs4 depends
> on; in my case (it depends on libcfitsio):
>
> ----------8<---------------------
> libwcs 4 libcfitsio3 libc6 libm6
> ----------8<---------------------
>
> (do I need to specify libc and libm?)

I'd suggest reading deb-shlibs(5) as a start. But the general rule of
thumb is that the shlibs file needs to list the libraries (and versions)
that a package built against the particular library must depend on.

This - in most cases - is the shared library itself, and any other
libraries whose symbol it exports. So if your lib exports only its own
symbols, that's all the shlibs file needs to contain.

If it also exports another library's symbols, then those will need to be
added aswell.

> Then, I should install this in my installation rule in debian/rules. 
> Since I have still no specific installation rule, I would need to put
> the following rule to debian/rules, right? 
>
> -------------------------------------------------8<---------------------
> override_dh_install:
> 	dh_install debian/shlibs.libwcs4 debian/libwcs4/DEBIAN/shlibs
> -------------------------------------------------8<---------------------

No. Please read dh_installdeb(1).

> Since zlib was used as an example in the manual, I downloaded the
> debian.tar.gz of zlib to explore this rule, but I could not find it -- I
> could not find anything related to shlib??

zlib uses versioned symbols, a similar, but more... advanced
thing. Perhaps the manual should be updated to point to a simple package
that does use shlibs still.

> Then, the policy manual states that I have to put a a call to
> dpkg-shlibdeps into my debian/rules file, but to which rule do I have to
> add this?

debhelper (dh_shlibdeps) does this for you already.

> A last question: If I ignore the shared lib chapter of the policy manual
> completely, "lintian" does not complain with the default
> settings. However, with the "-I" option, I get the informational
>
> I: libwcs4: no-symbols-control-file usr/lib/libwcs.so.4.8.1
>
> Should I care now about this and if yes, how do I solve this?

symbols files are a trickier beast; I would ignore the warning for now,
until such time that you get more familiar with library packaging, and
understand what symbols files are for, and how they work.

> Sorry if this post looks stupid; but I feel a bit lost in the moment
> between the different Debian tools for the shared library creation (and
> this is my very first package for Debian).

If I may suggest, I'd urge you to try your hands with something easier
first. Library packaging is non-trivial, and requires great care, and
often deeper knowledge of Debian.

-- 
|8]


Reply to: