dpkg-shlibdeps
is a tool intended to figure out all the packages that your new package depends on by way of dynamic linking. It does this by checking all your new binaries to see what libs they are linked to, and what symbols from those libs are used, and then checking the dpkg database to see what packages own those libs and find the lowest package version necessary to provide the necessary symbols.
In your case, it sees that your application links with that libnetsnmp.so.30
, so it checks to see what package owns that library. Oops, no package does. That's where the error comes from--maybe you already know all that, but I thought I'd include it for context.
The right solution, now, depends on how you want to treat your custom-compiled snmp library. Basically the choices are (a) ship your custom libnetsnmp with your package, (b) package your custom libnetsnmp separately, or (c) don't use a custom libnetsnmp at all; use whatever libsnmp*
package your OS provides instead.
(a): To ship libnetsnmp with your package, you need to be careful to make sure it doesn't provide the same SONAME
as the standard libsnmp package, so they don't interfere with each other. The easiest way to do that is probably just to link against it statically (link against the .a
or .o
files instead of the .so
dynamic library). This might be frowned on if your package is intended for Debian or Ubuntu proper, but if you demonstrate that choices (b) and (c) aren't workable for you, it'll probably be fine.
(b): Packaging libraries correctly is a fairly in-depth topic; too much for a StackOverflow answer. But documentation is out there. Depending on how much your libnetsnmp is changed from the upstream version, you may want to change the name of the library (and SONAME
) to avoid any confusion. If your libnetsnmp is just a backport of the newer libsnmp packages in Debian sid or Ubuntu, then the right thing might be to ship a copy of the "official" libsnmp30
deb in your PPA or arrange for libsnmp30
to be shipped in a -backports repository. Then you would just need to add a Build-Depends:
on libsnmp-dev (>= whatever)
to your package, and build against that (instead of a manually-installed .so file in /usr/local
).
(c): If you didn't actually need to do a custom compilation of snmp, and the version available in your OS/distro is good enough, then just Build-Depends:
on that, and remove the manually installed .so file in /usr/local
.