sensors-detect: added patch to correctly detect kernel version

switch to systemd support [release 3.3.5-2mamba;Tue Jun 10 2014]
This commit is contained in:
Silvan Calarco 2024-01-06 06:27:01 +01:00
parent 0e56c6bfa6
commit 90e2961817
3 changed files with 70 additions and 34 deletions

View File

@ -1,13 +0,0 @@
diff -Nru lm_sensors-3.3.1.orig/prog/detect/sensors-detect lm_sensors-3.3.1/prog/detect/sensors-detect
--- lm_sensors-3.3.1.orig/prog/detect/sensors-detect 2011-07-10 21:22:53.000000000 +0200
+++ lm_sensors-3.3.1/prog/detect/sensors-detect 2012-01-06 16:41:53.139801191 +0100
@@ -2472,7 +2472,8 @@
sub initialize_kernel_version
{
- `uname -r` =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
+ #Third decimal only for point releases starting with 3.0
+ `uname -r` =~ /(\d+)\.(\d+)(\.(\d+))?(.*)/;
@kernel_version = ($1, $2, $3, $4);
chomp($kernel_arch = `uname -m`);

View File

@ -0,0 +1,14 @@
diff -Nru lm_sensors-3.3.5.orig/prog/detect/sensors-detect lm_sensors-3.3.5/prog/detect/sensors-detect
--- lm_sensors-3.3.5.orig/prog/detect/sensors-detect 2014-01-14 22:51:58.615935000 +0100
+++ lm_sensors-3.3.5/prog/detect/sensors-detect 2014-06-10 14:29:27.202205868 +0200
@@ -2674,8 +2674,8 @@
sub initialize_kernel_version
{
chomp($kernel_version = `uname -r`);
- $kernel_version =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
- @kernel_version = ($1, $2, $3, $4);
+ $kernel_version =~ /(\d+)\.(\d+)(.*)/;
+ @kernel_version = ($1, $2, $3);
chomp($kernel_arch = `uname -m`);
# We only support kernels >= 2.6.5

View File

@ -1,6 +1,6 @@
Name: lm_sensors Name: lm_sensors
Version: 3.3.5 Version: 3.3.5
Release: 1mamba Release: 2mamba
Summary: Tools for monitoring the hardware health of Linux systems Summary: Tools for monitoring the hardware health of Linux systems
Group: System/Kernel and Hardware Group: System/Kernel and Hardware
Vendor: openmamba Vendor: openmamba
@ -8,14 +8,17 @@ Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.lm-sensors.org/ URL: http://www.lm-sensors.org/
Source: http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-%{version}.tar.bz2 Source: http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-%{version}.tar.bz2
Patch: %{name}-3.3.1-kernel-3.0.patch Patch0: lm_sensors-3.3.5-kernel-detect-openmamba.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: libperl
BuildRequires: perl-devel BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: libsystemd-devel
BuildRequires: libsysfs-devel >= 2.0.0 BuildRequires: libsysfs-devel >= 2.0.0
BuildRequires: flex BuildRequires: flex
Requires(post): systemd-core
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%description %description
@ -33,7 +36,7 @@ This package contains static libraries and header files need for development.
%prep %prep
%setup -q %setup -q
#%patch0 -p1 %patch0 -p1
%build %build
%make user PREFIX=%{_prefix} MANDIR=%{_mandir} LIBDIR=%{_libdir} %make user PREFIX=%{_prefix} MANDIR=%{_mandir} LIBDIR=%{_libdir}
@ -42,16 +45,12 @@ This package contains static libraries and header files need for development.
[ "%{buildroot}" != / ] && rm -rf %{buildroot} [ "%{buildroot}" != / ] && rm -rf %{buildroot}
make user_install MANDIR=%{_mandir} PREFIX=%{_prefix} DESTDIR=%{buildroot} LIBDIR=%{_libdir} make user_install MANDIR=%{_mandir} PREFIX=%{_prefix} DESTDIR=%{buildroot} LIBDIR=%{_libdir}
install -D -m 0755 prog/init/fancontrol.init %{buildroot}%{_initrddir}/fancontrol install -D -m 0755 prog/init/fancontrol.service %{buildroot}%{_unitdir}/fancontrol.service
install -D -m 0755 prog/init/lm_sensors.init %{buildroot}%{_initrddir}/lm_sensors install -D -m 0755 prog/init/lm_sensors.service %{buildroot}%{_unitdir}/lm_sensors.service
#install -D -m 0755 prog/init/sensord.init %{buildroot}%{_initrddir}/sensord install -D -m 0755 prog/init/sensord.service %{buildroot}%{_unitdir}/sensord.service
install -d %{buildroot}%{_sysconfdir}/sysconfig #install -d %{buildroot}%{_sysconfdir}/sysconfig
> %{buildroot}%{_sysconfdir}/sysconfig/lm_sensors #> %{buildroot}%{_sysconfdir}/sysconfig/lm_sensors
sed -i "s|/usr/local|/usr|" \
%{buildroot}%{_initrddir}/fancontrol \
%{buildroot}%{_initrddir}/lm_sensors
# remove installed kernel headers that will cause a conflict # remove installed kernel headers that will cause a conflict
rm -f %{buildroot}%{_includedir}/linux/*.h rm -f %{buildroot}%{_includedir}/linux/*.h
@ -61,6 +60,24 @@ rm -f %{buildroot}%{_includedir}/linux/*.h
%post %post
/sbin/ldconfig /sbin/ldconfig
:
%preun
if [ $1 -eq 0 ]; then
systemctl -q stop lm_sensors
systemctl -q stop fancontrol
systemctl -q stop sensord
fi
:
%postun
/sbin/ldconfig
if [ $1 -eq 0 ]; then
systemctl -q daemon-reload
fi
:
%posttrans
%ifnarch arm %ifnarch arm
# FIXME: produces a system crash on ARM build platform, disable until better tests are done # FIXME: produces a system crash on ARM build platform, disable until better tests are done
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
@ -81,34 +98,52 @@ if [ $1 -ge 1 ]; then
_EOF _EOF
systemctl -q daemon-reload
if [ -e %{_sysconfdir}/sysconfig/lm_sensors ]; then
systemctl -q enable lm_sensors
systemctl -q restart lm_sensors
fi
if [ -e %{_sysconfdir}/fancontrol ]; then
systemctl -q enable fancontrol
systemctl -q restart fancontrol
fi
if [ -e %{_sysconfdir}/sysconfig/sensorsd ]; then
systemctl -q enable sensord
systemctl -q restart sensord
fi
fi fi
%endif %endif
exit 0 :
%postun -p /sbin/ldconfig
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/* %{_bindir}/*
%{_sbindir}/* %{_sbindir}/*
%config(noreplace) %{_sysconfdir}/sensors3.conf %config(noreplace) %{_sysconfdir}/sensors3.conf
%ghost %{_sysconfdir}/sysconfig/lm_sensors #%ghost %{_sysconfdir}/sysconfig/lm_sensors
%{_initrddir}/* %{_unitdir}/fancontrol.service
%{_unitdir}/lm_sensors.service
%{_unitdir}/sensord.service
%{_mandir}/man1/* %{_mandir}/man1/*
%{_mandir}/man5/* %{_mandir}/man5/*
%{_mandir}/man8/* %{_mandir}/man8/*
%{_libdir}/*.so.* %{_libdir}/libsensors.so.*
%doc CHANGES CONTRIBUTORS COPYING README %doc COPYING
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/*.so %{_libdir}/libsensors.so
%{_libdir}/*.a %{_libdir}/libsensors.a
%dir %{_includedir}/sensors %dir %{_includedir}/sensors
%{_includedir}/sensors/*.h %{_includedir}/sensors/*.h
%{_mandir}/man3/* %{_mandir}/man3/*
%doc CHANGES CONTRIBUTORS README
%changelog %changelog
* Tue Jun 10 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.3.5-2mamba
- sensors-detect: added patch to correctly detect kernel version
- switch to systemd support
* Sun Feb 02 2014 Automatic Build System <autodist@mambasoft.it> 3.3.5-1mamba * Sun Feb 02 2014 Automatic Build System <autodist@mambasoft.it> 3.3.5-1mamba
- automatic version update by autodist - automatic version update by autodist