[Nut-upsdev] pkgconfig fix for nut

Stanislav Brabec sbrabec at suse.cz
Wed Aug 8 09:54:44 UTC 2007


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.

> 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 .

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: sbrabec at suse.cz
Lihovarská 1060/12                            tel: +420 284 028 966
190 00 Praha 9                                fax: +420 284 028 951
Czech Republic                                http://www.suse.cz/




More information about the Nut-upsdev mailing list