[Nut-upsuser] Network UPS Tools 2.4.3 - compile on RHEL5

Arjen de Korte nut+users at de-korte.org
Fri Feb 26 11:51:44 UTC 2010

Citeren "Yury V. Zaytsev" <yury op shurup.com>:

> So apparently Debian line takes precedence over the Redhat line (which
> turns out to be useless).

Not at all. On Debian the HAL_CALLOUTS_PATH is set by pkg-config. The check

	if (test -d "${libdir}/hal"); then

always fails, because at the time this check is performed the  
${libdir} variable isn't expanded yet (the path must be hardcoded in  
order for this test to make sense). So here it will literally check  
for the existence of the path ${libdir}/hal which obviously doesn't  
exist. So the first check that is performed after pkg-config failed  
and the above test failed too is

	elif (test -d "/usr/libexec"); then

According to our information, this is where the HAL_CALLOUTS_PATH  
should point to on RedHat (and which presumably is equal to  

> The next test for OpenSuse, by the way, will
> only work on 32-bit platforms, because the lib path is hardcoded and
> apparently will fail anyway, because they do have /usr/libexec.

Nonsense. Regardless of the platform, these binaries should go to  
/usr/lib/hal. See the following output (I run openSUSE-11.2 x86_64)

	# test -d /usr/lib/hal; echo $?
	# test -d /usr/libexec; echo $?

So on a 32-bit system, you should run ./configure with

	--libdir=/usr/lib --libexecdir=/usr/lib/hal

and on a 64-bit system, it should be

	--libdir=/usr/lib64 --libexecdir=/usr/lib/hal

> Therefore, I suspect that the detection logic in nut_check_libhal.m4 is
> broken. Is it indeed the case or I have to read some magic files for
> enlightenment?

It isn't (at least not on the machines we tested on).

> I would suggest to swap the order of Debian and Redhat lines and for
> Redhat check against the existence of /etc/redhat-release which is
> guaranteed to be there on all RH distributions.

We're not checking for a specific distro here, only for a pathname  
(and we only put the comments there for reference).

Best regards, Arjen
Please keep list traffic on the list

More information about the Nut-upsuser mailing list