- Remove no longer needed patches 1, 2 & 6

- Various specfile cleanups to match the Fedora packaging guidelines this
    fixes bz 238787 amongst other things
- Use lm_sensors provided initscript instead of our own private one, this
    stops the sometimes unnecessary loading of i2c-dev
- No longer ship a static version of the library in -devel
- Compile sensord and eepromer extra programs and put each in its own
    subpackage (bz 236904)
This commit is contained in:
Hans de Goede 2007-07-10 20:58:05 +00:00
parent 2a2aa3ec20
commit 19d6c59990
8 changed files with 185 additions and 273 deletions

View File

@ -1,18 +1,3 @@
--- lm_sensors-2.10.0/prog/dump/isadump.c.kernel26 2006-05-12 15:26:05.000000000 +0200
+++ lm_sensors-2.10.0/prog/dump/isadump.c 2006-05-12 16:45:44.000000000 +0200
@@ -36,12 +36,7 @@
#include "superio.h"
-/* To keep glibc2 happy */
-#if 0 && defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
#include <sys/io.h>
-#else
-#include <asm/io.h>
-#endif
#ifdef __powerpc__
unsigned long isa_io_base = 0; /* XXX for now */
--- lm_sensors-2.10.0/prog/detect/sensors-detect.kernel26 2006-05-12 15:24:05.000000000 +0200
+++ lm_sensors-2.10.0/prog/detect/sensors-detect 2006-05-12 15:24:05.000000000 +0200
@@ -2034,6 +2034,8 @@

View File

@ -1,11 +0,0 @@
--- lm_sensors-2.5.5/prog/dump/isadump.c.glibc22 Mon Feb 5 22:56:47 2001
+++ lm_sensors-2.5.5/prog/dump/isadump.c Mon Feb 5 22:55:35 2001
@@ -25,7 +25,7 @@
/* To keep glibc2 happy */
-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+#if 0 && defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
#include <sys/io.h>
#else
#include <asm/io.h>

View File

@ -1,72 +0,0 @@
--- lm_sensors-2.8.3/Makefile.redhat 2003-12-29 20:29:16.000000000 +0100
+++ lm_sensors-2.8.3/Makefile 2004-03-08 16:37:36.262280059 +0100
@@ -44,7 +44,7 @@
# may be used mistakenly. Note: This should point to the directory
# *above* the linux/ subdirectory, so to /usr/local/include in the
# above example.
-I2C_HEADERS := /usr/local/include
+I2C_HEADERS := /usr/src/linux/include
#I2C_HEADERS := $(LINUX_HEADERS)
# Uncomment the third line on SMP systems if the magic invocation fails. It
@@ -63,8 +63,8 @@
# Uncomment the second line if you are a developer. This will enable many
# additional warnings at compile-time
-WARN := 0
-#WARN := 1
+#WARN := 0
+WARN := 1
# Uncomment the second line if you want to get (loads of) debug information
# at run-time.
@@ -77,7 +77,7 @@
DESTDIR :=
# This is the prefix that will be used for almost all directories below.
-PREFIX := /usr/local
+PREFIX := $(prefix)
# This is the main modules directory into which the modules will be installed.
# The magic invocation will return something like this:
@@ -89,11 +89,11 @@
# This is the directory where sensors.conf will be installed, if no other
# configuration file is found
-ETCDIR := /etc
+ETCDIR := $(sysconfdir)
# You should not need to change this. It is the directory into which the
# library files (both static and shared) will be installed.
-LIBDIR := $(PREFIX)/lib
+LIBDIR := $(libdir)
EXLDFLAGS := -Wl,-rpath,$(LIBDIR)
@@ -104,8 +104,8 @@
# Note that not all programs in this package are really installed;
# some are just examples. You can always install them by hand, of
# course.
-BINDIR := $(PREFIX)/bin
-SBINDIR := $(PREFIX)/sbin
+BINDIR := $(bindir)
+SBINDIR := $(sbindir)
# You should not need to change this. It is the basic directory into which
# include files will be installed. The actual directory will be
@@ -113,13 +113,13 @@
# for library include files. If PREFIX equals the default /usr/local/bin,
# you will be able to use '#include <linux/sensors.h>' regardless of the
# current kernel selected.
-INCLUDEDIR := $(PREFIX)/include
+INCLUDEDIR := $(includedir)
SYSINCLUDEDIR := $(INCLUDEDIR)/linux
LIBINCLUDEDIR := $(INCLUDEDIR)/sensors
# You should not need to change this. It is the base directory under which the
# manual pages will be installed.
-MANDIR := $(PREFIX)/man
+MANDIR := $(mandir)
MACHINE := $(shell uname -m)

View File

@ -1,12 +0,0 @@
--- lm_sensors-2.8.3/Makefile.rpath 2004-03-08 18:06:52.318271655 +0100
+++ lm_sensors-2.8.3/Makefile 2004-03-08 18:08:30.344078783 +0100
@@ -95,7 +95,8 @@
# library files (both static and shared) will be installed.
LIBDIR := $(libdir)
-EXLDFLAGS := -Wl,-rpath,$(LIBDIR)
+#EXLDFLAGS := -Wl,-rpath,$(LIBDIR)
+EXLDFLAGS :=
# You should not need to change this. It is the directory into which the
# executable program files will be installed. BINDIR for programs that are

View File

@ -1,137 +0,0 @@
#!/bin/sh
#
# chkconfig: 2345 26 74
# description: sensors is used for monitoring motherboard sensor values.
# config: /etc/sysconfig/lm_sensors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# See also the lm_sensors homepage at:
# http://www2.lm-sensors.nu/~lm78/index.html
# It uses a config file /etc/sysconfig/lm_sensors that contains the modules to
# be loaded/unloaded. That file is sourced into this one.
# The format of that file a shell script that simply defines the modules
# in order as normal shell variables with the special names:
# MODULE_1, MODULE_2, MODULE_3, etc.
# If sensors isn't supported by the kernel, try loading the module...
[ -e /sys/bus/i2c ] || /sbin/modprobe i2c-dev &>/dev/null
[ -e /sys/bus/i2c ] || sleep 1
# Don't bother if /sys/bus/i2c still doesn't exist, kernel doesn't have
# support for sensors.
[ -e /sys/bus/i2c ] || exit 0
CONFIG=/etc/sysconfig/lm_sensors
[ -r "$CONFIG" ] || exit 0
egrep '^MODULE_' $CONFIG &>/dev/null || exit 0
# Load config file
. "$CONFIG"
PSENSORS=/usr/bin/sensors
# Source function library.
. /etc/init.d/functions
RETVAL=0
prog="lm_sensors"
start() {
echo -n $"Starting $prog: "
/sbin/MAKEDEV i2c
modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
i=0
while [ $i -lt $modules ] ; do
module=`eval echo '$'MODULE_$i`
# echo starting module __${module}__
/sbin/modprobe $module &>/dev/null
i=`expr $i + 1`
done
$PSENSORS -s
RETVAL=$?
if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lm_sensors ; then
echo_success
echo
else
echo_failure
echo
fi
}
stop() {
echo -n $"Stopping $prog: "
modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
i=`expr $modules`
while [ $i -ge 0 ] ; do
module=`eval echo '$'MODULE_$i`
/sbin/modprobe -r $module &>/dev/null
i=`expr $i - 1`
done
RETVAL=$?
if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lm_sensors ; then
echo_success
echo
else
echo_failure
echo
fi
}
dostatus() {
$PSENSORS
RETVAL=$?
}
restart() {
stop
start
RETVAL=$?
}
condrestart() {
[ -e /var/lock/subsys/lm_sensors ] && restart || :
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
dostatus
;;
restart|reload)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
exit $RETVAL

View File

@ -1,19 +1,18 @@
Name: lm_sensors
Version: 2.10.3
Release: 2%{?dist}
Release: 3%{?dist}
URL: http://secure.netroedge.com/~lm78/
Source: http://secure.netroedge.com/~lm78/archive/lm_sensors-%{version}.tar.gz
Source1: lm_sensors.sysconfig
Source2: lm_sensors.init
Patch1: lm_sensors-2.5.5-glibc22.patch
Patch2: lm_sensors-2.8.3-redhat.patch
# these 2 were taken from PLD-linux, Thanks!
Source2: sensord.sysconfig
Source3: sensord.init
Patch3: lm_sensors-2.8.0-utf8.patch
Patch4: lm_sensors-2.8.2-expr.patch
Patch5: lm_sensors-2.10.1-local.patch
Patch6: lm_sensors-2.8.3-rpath.patch
Patch7: lm_sensors-2.8.7-udev.patch
Patch8: lm_sensors-2.10.0-kernel26.patch
Summary: Hardware monitoring tools.
Summary: Hardware monitoring tools
Group: Applications/System
License: GPL
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -22,7 +21,9 @@ Requires: /usr/sbin/dmidecode
%endif
Requires(preun): chkconfig
Requires(post): chkconfig
Requires(post): /sbin/ldconfig
BuildRequires: kernel-headers >= 2.2.16, bison, libsysfs-devel, flex
BuildRequires: rrdtool-devel
ExclusiveArch: alpha %{ix86} x86_64
%description
@ -30,53 +31,85 @@ The lm_sensors package includes a collection of modules for general SMBus
access and hardware monitoring. NOTE: this requires special support which
is not in standard 2.2-vintage kernels.
%package devel
Summary: Development files for programs which will use lm_sensors.
Summary: Development files for programs which will use lm_sensors
Group: Development/System
Requires: lm_sensors = %{version}
Requires: %{name} = %{version}-%{release}
%description devel
The lm_sensors-devel package includes a header files and libraries for use
when building applications that make use of sensor data.
%package sensord
Summary: Daemon that periodically logs sensor readings
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description sensord
Daemon that periodically logs sensor readings to syslog or a round-robin
database, and warns of sensor alarms.
%package eepromer
Summary: Programs for reading / writing i2c / smbus eeproms
Group: Applications/System
%description eepromer
Programs for reading / writing i2c / smbus eeproms. Notice that writing the
eeproms in your system is very dangerous and is likely to render your system
unusable. Do not install, let alone use this, unless you really, _really_ know
what you are doing.
%prep
%setup -q
%patch1 -p1 -b .glibc22
%patch2 -p1 -b .redhat
%patch3 -p1 -b .utf8
%patch4 -p1 -b .expr
%patch5 -p1 -b .local
%patch6 -p1 -b .rpath
%patch7 -p1 -b .udev
%patch8 -p1 -b .kernel26
mv prog/init/README prog/init/README.initscripts
chmod -x prog/init/fancontrol.init
%build
mkdir -p kernel/include/linux
ln -sf /usr/include/linux/* kernel/include/linux
export CFLAGS="%{optflags}"
make prefix=/usr exec_prefix=/usr bindir=/usr/bin sbindir=/usr/sbin sysconfdir=/etc datadir=/usr/share includedir=/usr/include libdir=%{_libdir} libexecdir=/usr/libexec localstatedir=/var sharedstatedir=/usr/com mandir=/usr/share/man infodir=/usr/share/info user
make PREFIX=%{_prefix} LIBDIR=%{_libdir} MANDIR=%{_mandir} EXLDFLAGS= \
PROG_EXTRA=sensord user
pushd prog/eepromer
make
popd
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
make prefix=/usr exec_prefix=/usr bindir=/usr/bin sbindir=/usr/sbin sysconfdir=/etc datadir=/usr/share includedir=/usr/include libdir=%{_libdir} libexecdir=/usr/libexec localstatedir=/var sharedstatedir=/usr/com mandir=/usr/share/man infodir=/usr/share/info DESTDIR=$RPM_BUILD_ROOT user_install
chmod 755 $RPM_BUILD_ROOT%{_libdir}/*.so*
mv prog/init/README prog/init/README.initscripts
rm -fr $RPM_BUILD_ROOT
make PREFIX=%{_prefix} LIBDIR=%{_libdir} MANDIR=%{_mandir} PROG_EXTRA=sensord \
DESTDIR=$RPM_BUILD_ROOT user_install
install -m 755 prog/eepromer/{eepromer,eeprom,eeprog} \
$RPM_BUILD_ROOT%{_sbindir}
rm $RPM_BUILD_ROOT%{_libdir}/libsensors.a
# Remove userland kernel headers, belong in glibc-kernheaders.
rm -rf $RPM_BUILD_ROOT%{_includedir}/linux
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lm_sensors
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lm_sensors
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/sensord
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/lm_sensors
install -p -m 755 prog/init/lm_sensors.init \
$RPM_BUILD_ROOT%{_initrddir}/lm_sensors
install -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/sensord
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
rm -fr $RPM_BUILD_ROOT
%pre
if [ -f /var/lock/subsys/sensors ]; then
mv -f /var/lock/subsys/sensors /var/lock/subsys/lm_sensors
mv -f /var/lock/subsys/sensors /var/lock/subsys/lm_sensors
fi
%post
@ -91,24 +124,58 @@ if [ $1 = 0 ]; then
fi
%post sensord
/sbin/chkconfig --add sensord
%preun sensord
if [ $1 = 0 ]; then
/sbin/chkconfig --del sensord
fi
%files
%defattr(-,root,root)
%doc BACKGROUND BUGS CHANGES CONTRIBUTORS COPYING doc INSTALL QUICKSTART README* TODO prog/init/*
%doc BACKGROUND BUGS CHANGES CONTRIBUTORS COPYING doc README* TODO
%doc prog/init/fancontrol.init prog/init/README.initscripts
%config(noreplace) %{_sysconfdir}/sensors.conf
%{_bindir}/*
%{_libdir}/*.so.*
%{_mandir}/man*/*
%{_sbindir}/*
%config %{_initrddir}/lm_sensors
%{_initrddir}/lm_sensors
%config(noreplace) %{_sysconfdir}/sysconfig/lm_sensors
%exclude %{_sbindir}/sensord
%exclude %{_sbindir}/eepro*
%files devel
%defattr(-,root,root)
%{_includedir}/sensors
%{_libdir}/lib*.a
%{_libdir}/lib*.so
%files sensord
%defattr(-,root,root,-)
%doc prog/sensord/README
%{_sbindir}/sensord
%{_initrddir}/sensord
%config(noreplace) %{_sysconfdir}/sysconfig/sensord
%files eepromer
%defattr(-,root,root,-)
%doc prog/eepromer/README*
%{_sbindir}/eepro*
%changelog
* Mon Jul 9 2007 Hans de Goede <j.w.r.degoede@hhs.nl> - 2.10.3-3
- Remove no longer needed patches 1, 2 & 6
- Various specfile cleanups to match the Fedora packaging guidelines
this fixes bz 238787 amongst other things
- Use lm_sensors provided initscript instead of our own private one, this
stops the sometimes unnecessary loading of i2c-dev
- No longer ship a static version of the library in -devel
- Compile sensord and eepromer extra programs and put each in its own
subpackage (bz 236904)
* Tue Apr 17 2007 Phil Knirsch <pknirsch@redhat.com> - 2.10.3-2
- Fixed one more problem with sensors-detect (#215984)

76
sensord.init Normal file
View File

@ -0,0 +1,76 @@
#!/bin/sh
#
# sensord: Hardware sensors monitoring daemon
#
# chkconfig: - 27 73
# description: Starts and stops hardware sensors monitoring daemon.
# config: /etc/sysconfig/sensord
# author: Filip Kalinski <filon@pld.org.pl>
# adapted for fedora by Hans de Goede <j.w.r.degoede@hhs.nl>
# Source function library.
. /etc/rc.d/init.d/functions
# Get service config
if [ -f /etc/sysconfig/sensord ]; then
. /etc/sysconfig/sensord
fi
prog="sensord"
start() {
echo -n $"Starting $prog: "
if [ ! -f /var/lock/subsys/lm_sensors ]; then
echo -n "error lm_sensors service not started"
echo_failure
echo
exit 6
fi
daemon sensord \
${INTERVAL:+-i $INTERVAL} \
${LOG_INTERVAL:+-l $LOG_INTERVAL} \
${RRD_LOGFILE:+-r $RRD_LOGFILE} \
${RRD_INTERVAL:+-t $RRD_INTERVAL} \
-f daemon
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sensord
}
stop() {
echo -n $"Stopping $prog: "
killproc sensord
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sensord
}
RETVAL=0
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status sensord
RETVAL=$?
sensors
;;
restart|force-reload)
stop
start
;;
*)
msg_usage "$0 {start|stop|restart|force-reload|status}"
exit 3
esac
exit $RETVAL

16
sensord.sysconfig Normal file
View File

@ -0,0 +1,16 @@
# configuration for harware sensors monitoring daemon
# in intevrals use suffix "m" for minutes, "s" for seconds, "h" for hours
# 0 means turning facility off
# interval between scanning alarms
INTERVAL=1m
# interval between logging
LOG_INTERVAL=20m
# interval between RRD logging
# RRD_INTERVAL=1m
# RRD db location
# RRD_LOGFILE=/var/log/sensors.rrd