[Nut-upsdev] pkgconfig fix for nut

Arnaud Quette aquette.dev at gmail.com
Wed Aug 8 18:45:47 UTC 2007


fellows,

2007/8/8, Peter Selinger <selinger at mathstat.dal.ca>:
> 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.
>
> Indeed.
>
> > 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.

that's true for Debian (and derivative), Fedora and Mandriva.
*but* SuSE still provide one big RPM including everything...
along with the many diversion between the various packages led me to
(try to) launch the NUT Packaging Standard effort. still for soon, but
not yet.

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

I've already fixed this, few days after 2.2.0 release, while I was
working on an MGE PSP update (1020 and 1021).

> Objections, anyone?

none

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

wmnut and MGE PSP are the only I know at the present time.
many other clients simply reimplement the protocol.

Arnaud
-- 
Free Software Developer - http://arnaud.quette.free.fr/
Debian Developer - http://people.debian.org/~aquette/
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Ubuntu Media Center (UMC) Project Leader - https://launchpad.net/~umc-team



More information about the Nut-upsdev mailing list