Package Dependencies

When packaging a new program for the first time one of the big headaches is figuring out where all your dependencies are.  This difficulty is greatly mitigated on openSUSE by a little tool called webpin.  It's available in the openSUSE:Tools repository.

When you first build out your basic spec file you have little or no idea what goes in BuildRequires.  For a few projects you don't need anything there at all so I like to just go ahead and run osc build and see what happens. If you're not using OBS to build your software then I'm very sorry for you. Usually the configure script will stop somewhere saying that it couldn't find something it needs, usually a header file or a pkg-config (.pc) file. This is where webpin comes in.

Suppose you get a line that says:

No package 'avahi-sharp' found

This means that configure is looking for a pkg-config file called avahi-sharp.pc. So with webpin installed we type webpin avahi-sharp.pc and we get a result that looks something like this:

` 1 results (1 packages) found for "avahi-sharp.pc" in openSUSE_110 * avahi-mono: Mono Bindings for avahi, the D-BUS Service for Zeroconf and Bonjour - 0.6.22 [suse-oss]

/usr/lib/pkgconfig/avahi-sharp.pc`

Now we know to add avahi-mono to our BuildRequires.

Later we might get an error that looks like this:

session-glue.c:5:26: error: X11/SM/SMlib.h: No such file or directory

Unfortunately for us this kind of error comes from gcc and is harder to see in all the gcc error: gobbledygook. If the upstream maintainer had been more careful we would have seen a configure error instead. But no matter! we just type webpin X11/SM/SMlib.h to find that this header file is found in xorg-x11-libSM-devel.

My new package packaging time is as much as cut in half thanks to this excellent tool. Many thanks to those responsible. There is also a web interface for webpin (I'm pretty sure it started out that way, hence the name).

Side note: RPM really needs to have automatic provides for pkg-config files so that we can use BuildRequires: pc(avahi-sharp) >= 0.6 instead of explicit package names. pkg-config is one of the best things to happen to software in a long time IMHO and RPM should be taking full advantage of it.

The package used for this example was Tangerine, a very nice little DAAP server written by James Willcox.

Comments !