# conditional build
# _without_dist_kernel without kernel for distributions
+#
%include /usr/lib/rpm/macros.perl
-%define _rel 0.9
+
+%define _kernel_ver %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
+%define _kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
Summary: Hardware health monitoring
Summary(pl): Monitor stanu sprzêtu
Summary(ru): õÔÉÌÉÔÙ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ ÁÐÐÁÒÁÔÕÒÙ
Summary(uk): õÔÉ̦ÔÉ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ ÁÐÁÒÁÔÕÒÉ
Name: lm_sensors
-Version: 2.6.4
+Version: 2.6.5
+%define _rel 1
Release: %{_rel}
License: GPL
Group: Applications/System
Source1: sensors.init
Source2: sensors.sysconfig
Patch0: %{name}-make.patch
+Patch1: %{name}-ppc.patch
URL: http://www.lm-sensors.nu/
BuildRequires: bison
BuildRequires: flex >= 2.5.1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Obsoletes: liblm_sensors1
+%define _kernel24 %(echo %{_kernel_ver} | grep -q '2\.[012]\.' ; echo $?)
+
%description
Tools for monitoring the hardware health of Linux systems containing
hardware health monitoring hardware such as the LM78 and LM75.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%build
#up
MODDIR=/lib/modules/%{_kernel_ver}smp/misc \
MODPREF=/lib/modules/%{_kernel_ver}smp
-install prog/eepromer/{eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
+install prog/eepromer/{eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
install prog/dump/{i2c{dump,set},isadump} $RPM_BUILD_ROOT%{_sbindir}
+install prog/detect/i2cdetect $RPM_BUILD_ROOT%{_sbindir}
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensors
%clean
rm -rf $RPM_BUILD_ROOT
-%post
-/sbin/ldconfig
+%post -p /sbin/ldconfig
+
+%post sensord
/sbin/chkconfig --add sensors
if [ -f /var/lock/subsys/sensors ]; then
/etc/rc.d/init.d/sensors restart >&2
else
- echo "You have to configure sensors modules."
- echo "Please edit /etc/sysconfig/sensors file according to your hardware."
+ echo "You have to configure sensors modules in /etc/sysconfig/sensors"
echo
echo "Run \"/etc/rc.d/init.d/sensors start\" to start sensors daemon." >&2
fi
-%preun
+%preun sensord
if [ "$1" = "0" ]; then
if [ -f /var/lock/subsys/sensors ]; then
/etc/rc.d/init.d/sensors stop >&2
%doc prog/{config,daemon,eeprom,eepromer/README*,matorb,maxilife,xeon}
%attr(755,root,root) %{_bindir}/sensors
%attr(755,root,root) %{_sbindir}/sensors-detect
+%if %{_kernel24}
+%attr(755,root,root) %{_sbindir}/dmidecode
+%endif
%attr(755,root,root) %{_sbindir}/eeprom*
%attr(755,root,root) %{_sbindir}/i2c*
%attr(755,root,root) %{_sbindir}/isadump