sensors/sensors.spec

248 lines
7.7 KiB
RPMSpec
Raw Blame History

#
# spec file for package sensors
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: sensors
BuildRequires: bison
BuildRequires: flex
BuildRequires: rrdtool-devel
Url: http://www.lm-sensors.org/
Version: 3.3.4
Release: 0
Summary: Hardware health monitoring for Linux
License: GPL-2.0+
Group: System/Monitoring
Requires: modutils
Source0: http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-%{version}.tar.bz2
Source1: lm_sensors.init
Source2: baselibs.conf
Patch1: lm_sensors-3.1.1-build.patch
Patch2: lm_sensors-3.0.0-sensord-separate.patch
Patch3: lm_sensors-3.0.0-sysconfig_metadata.patch
Patch4: lm_sensors-3.0.3-hint-at-kernel-extra-package.patch
Patch5: lm_sensors-r6181-fix-service-files.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: s390 s390x
BuildRequires: systemd
%{?systemd_requires}
%description
This package includes programs that show data from some sensor chips.
The interface /proc/bus/i2c/ is provided by loading kernel modules.
Which modules to load can be interactively detected as root by calling
/usr/sbin/sensors-detect. Warning, before using the sensors the default
configuration in /etc/sensors.conf has to be checked and changed to fit
the actual set up of the mainboard and the BIOS used on that specific
mainboard!
Authors:
--------
Simon G. Vogl <simon@tk.uni-linz.ac.at>
Mark D. Studebaker <mds@eng.paradyne.com>
Philip Edelbrock <phil@netroedge.com>
Ky<EFBFBD>sti M<EFBFBD>lkki <kmalkki@cc.hut.fi>
Fons Rademakers <Fons.Rademakers@cern.ch>
Frodo Looijaard <frodol@dds.nl>
Geert Uytterhoeven <geert@linux-m68k.org>
%package -n sensord
Summary: Hardware health monitoring daemon
License: GPL-2.0+
Group: System/Monitoring
Provides: sensors:/usr/sbin/sensord
%description -n sensord
sensord is a daemon that can be used to periodically log sensor
readings from hardware health-monitoring chips to the system logs or a
round-robin database (RRD) and to alert when a sensor alarm is
signalled; for example, if a fan fails, a temperature limit is
exceeded, etc.
Authors:
--------
Merlin Hughes <merlin@merlin.org>
%package -n libsensors4
Summary: Hardware health monitoring library
License: LGPL-2.1+
Group: System/Libraries
%description -n libsensors4
libsensors offers a way for applications to access the hardware
monitoring chips of the system. A system-dependent configuration file
controls how the different inputs are labeled and what scaling factors
have to be applied for the specific hardware, so that the output makes
sense to the user.
Authors:
--------
Mark D. Studebaker <mds@eng.paradyne.com>
Philip Edelbrock <phil@netroedge.com>
Ky<EFBFBD>sti M<EFBFBD>lkki <kmalkki@cc.hut.fi>
Frodo Looijaard <frodol@dds.nl>
Jean Delvare <khali@linux-fr.org>
Mark M. Hoffman <mhoffman@lightlink.com>
%package -n libsensors4-devel
Summary: Hardware health monitoring library
License: LGPL-2.1+
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libsensors4 = %{version}
Provides: sensors:/usr/include/sensors/sensors.h
Conflicts: libsensors3-devel
%description -n libsensors4-devel
libsensors offers a way for applications to access the hardware
monitoring chips of the system. A system-dependent configuration file
controls how the different inputs are labeled and what scaling factors
have to be applied for the specific hardware, so that the output makes
sense to the user.
Authors:
--------
Mark D. Studebaker <mds@eng.paradyne.com>
Philip Edelbrock <phil@netroedge.com>
Ky<EFBFBD>sti M<EFBFBD>lkki <kmalkki@cc.hut.fi>
Frodo Looijaard <frodol@dds.nl>
Jean Delvare <khali@linux-fr.org>
Mark M. Hoffman <mhoffman@lightlink.com>
%prep
%setup -q -n lm_sensors-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} MANDIR=%{_mandir} LIBDIR=%{_libdir}
%install
make PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} MANDIR=%{_mandir} LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT install
cd doc/
mkdir -p $RPM_BUILD_ROOT/%{_docdir}/sensors
cp -a donations $RPM_BUILD_ROOT/%{_docdir}/sensors/
cp -a fan-divisors $RPM_BUILD_ROOT/%{_docdir}/sensors/
cp -a fancontrol.txt $RPM_BUILD_ROOT/%{_docdir}/sensors/
cp -a temperature-sensors $RPM_BUILD_ROOT/%{_docdir}/sensors/
cp -a vid $RPM_BUILD_ROOT/%{_docdir}/sensors/
cp -a progs $RPM_BUILD_ROOT/%{_docdir}/sensors/
chmod -R u+rwX,g+rX,o+rX $RPM_BUILD_ROOT/%{_docdir}/sensors/
cd ../
chmod 0755 $RPM_BUILD_ROOT/%{_libdir}/libsensors.so.*
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m 0755 %{S:1} $RPM_BUILD_ROOT/etc/init.d/lm_sensors
ln -sf /etc/init.d/lm_sensors $RPM_BUILD_ROOT/usr/sbin/rclm_sensors
mkdir -p $RPM_BULID_ROOT/%{_unitdir}
cp -a prog/init/*.service $RPM_BULID_ROOT/%{_unitdir}/
%pre
%service_add_pre lm_sensors.service
%post
%service_add_post lm_sensors.service
sh -c '
CONFIG=/etc/sysconfig/lm_sensors
test -r "$CONFIG" || exit 0
unset ${!MODULE_*} $HWMON_MODULES
. "$CONFIG"
test -n "$HWMON_MODULES" && exit 0
for i in ${!MODULE_*} ; do
eval module=\$$i
if test -z "$HWMON_MODULES" ; then
HWMON_MODULES="$module"
else
HWMON_MODULES="$HWMON_MODULES $module"
fi
done
test -z "$HWMON_MODULES" && exit 0
echo >> "$CONFIG"
echo "# New configuration format generated by rpm post-install script" >> "$CONFIG"
echo "HWMON_MODULES=\"$HWMON_MODULES\"" >> "$CONFIG"
'
if test -e /etc/modprobe.d/lm_sensors -a ! -e /etc/modprobe.d/lm_sensors.conf ; then
mv -f /etc/modprobe.d/lm_sensors /etc/modprobe.d/lm_sensors.conf
fi
%preun
%service_del_preun lm_sensors.service
%{stop_on_removal lm_sensors}
%postun
%service_del_postun lm_sensors.service
%{insserv_cleanup}
%post -n libsensors4 -p /sbin/ldconfig
%postun -n libsensors4 -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_unitdir}/lm_sensors.service
%{_unitdir}/fancontrol.service
/etc/init.d/lm_sensors
/usr/sbin/rclm_sensors
/usr/bin/*
/usr/sbin/fancontrol
%ifarch i386 i486 i586 i686 x86_64
/usr/sbin/isadump
/usr/sbin/isaset
%endif
/usr/sbin/pwmconfig
/usr/sbin/sensors-detect
%doc %{_docdir}/sensors/
%doc /usr/share/man/man1/*.1.gz
%doc /usr/share/man/man8/fancontrol.8.gz
%ifarch i386 i486 i586 i686 x86_64
%doc /usr/share/man/man8/isadump.8.gz
%doc /usr/share/man/man8/isaset.8.gz
%endif
%doc /usr/share/man/man8/pwmconfig.8.gz
%doc /usr/share/man/man8/sensors-detect.8.gz
%files -n sensord
%defattr(-,root,root)
%{_unitdir}/sensord.service
/usr/sbin/sensord
%doc /usr/share/man/man8/sensord.8.gz
%files -n libsensors4
%defattr(-,root,root)
%config /etc/sensors3.conf
%config /etc/sensors.d/
%{_libdir}/libsensors.so.4*
%doc /usr/share/man/man5/*.5.gz
%files -n libsensors4-devel
%defattr(-,root,root)
/usr/include/sensors/
%{_libdir}/libsensors.so
%doc /usr/share/man/man3/*.3.gz
%changelog