[Nut-upsdev] pkgconfig fix for nut

Peter Selinger selinger at mathstat.dal.ca
Wed Aug 8 17:09:33 UTC 2007

Hi Stanislav,

Stanislav Brabec wrote:
> Peter Selinger wrote:
> > Dear Stanislav,
> >
> > thanks for your patch. The problem with your "recommended"
> > pkgconfigdir is that in many cases, it does not work. Namely, when
> > ${prefix} is not one of the standard places such as /usr.
> The correct way is adding your libdir pkgconfig path to $PKG_CONFIG_PATH
> (or directly to the default path of pkg-config using --with-pc_path
> while compiling pkg-config). If your distribution adds $prefix/bin to
> PATH and/or $prefix/$LIB to runtime linker path, but not
> $prefix/$LIB/pkgconfig to pkg-config path, then it is a distribution
> bug.
> > As I understand it, the whole point of a tool like pkgconfig is to
> > allow other software to automatically detect the install location of
> > NUT, especially when that location is not one of the standard ones. If
> > you therefore install the pkgconfig files in the same non-standard
> > location, then there is a circularity, as you could not find the
> > location of the pkgconfig data without reading the pkgconfig data
> > first.
> pkg-config should be configured to find libraries in non-standard
> location you want to include. You should be able to "connect" and
> "disconnect" non-standard locations from the system by changing of
> several variables and/or configuration file. It would not be possible,
> if .pc files are in the system default path.

Thanks for the explanation, this makes sense to me.

> > For this reason, our default behavior is to install the pkgconfig data
> > in a place where it can definitely be found, regardless of where NUT
> > is installed.
> At least in OpenSUSE on x86_64, files in /usr/lib/pkgconfig cannot be
> found. The default for 64-bit libraries is /usr/lib64/pkgconfig there,
> /usr/lib/pkgconfig can only contain references to 32-bit libraries,
> and /usr/share/pkgconfig, can contain architecture independent stuff.
> > The installer who doesn't like this can override it with
> > --with-pkgconfig-dir.
> >
> > There are also situations where you would not want to install
> > pkgconfig support at all. One cannot assume that all systems where NUT
> > runs are a Linux PC, or even a GNU system. NUT runs in a lot of
> > places, mostly servers. Some of them can be very old installations,
> > predating pkgconfig.
> Presence of this should break nothing, it's only a plain text file.


> I don't know any other project, which makes its .pc file optional.
> Packagers should put include, pkgconfig, la and so (symlink) to
> development subpackage.
> Well, if you decide to reject this cosmetic part of my patch, please
> apply chunks fixing @SSL_*FLAGS at .

I hadn't noticed the part about @SSL_*FLAGS at . Indeed, that was a bug.

I think what you suggest about pkgconfig makes sense; I would like to
change the default behavior to what you say. I would still like to
retain the ability for users to override the pkgconfig directory
though, both for backward compatibility and configurability. 

Objections, anyone?

P.S.: are there actually any other packages that link against
libupsclient, or is this a merely academic exercise?

-- Peter

More information about the Nut-upsdev mailing list