- Drop lm_sensors-revert-6b5a19b708.patch because the previously

incompatible types have been changed in the callee in package
  rrdtool too, which means that there is a type incompatibility again.
  Because the other change reportedly makes more snese, I'm dropping
  this one.

I am sorry for the noise, for removing a patch just after adding it.
But as explained in an email, when fixing dozens of packages, it is
not really possible for me to assume that call targets in another
packages might be a better place to address this.

If the request is OK, please forward it to Factory soon too so that it
does not blocking switching to GCC 14.  Thanks!

OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=127
This commit is contained in:
Jean Delvare 2024-08-13 12:59:59 +00:00 committed by Git OBS Bridge
commit 68ae91179e
13 changed files with 1714 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
baselibs.conf Normal file
View File

@ -0,0 +1,3 @@
libsensors4
obsoletes "sensors-<targettype> <= <version>"
provides "sensors-<targettype> = <version>"

3
lm-sensors-3-6-2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c6a0587e565778a40d88891928bf8943f27d353f382d5b745a997d635978a8f0
size 292327

View File

@ -0,0 +1,25 @@
From d68c760c8065ba542391c30863b5543d703e5b1b Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Mon, 26 Nov 2007 13:34:08 +0100
Subject: [PATCH 02/11] lm_sensors-3.0.0-sensord-separate
---
doc/progs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/doc/progs b/doc/progs
index 0c5464df..63f6e260 100644
--- a/doc/progs
+++ b/doc/progs
@@ -56,6 +56,8 @@ see https://github.com/lm-sensors/lm-sensors/
the sensors hardware to syslog, and to alert (using syslog level ALERT)
when a sensor alarm is signalled; for example, if a fan fails, a temperature
limit is exceeded, etc.
+ In SUSE Linux, this daemon is packaged separately. You have to explicitly
+ install the package named "sensord" if you want it.
* prog/sensors/sensors (written in C, installed by `make install')
This pretty-prints the information provided by the modules. It is a normal
--
2.43.0

View File

@ -0,0 +1,29 @@
From 4a0a238e350c31a328f6c473b35a19a1fbaa6138 Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Mon, 26 Nov 2007 13:34:08 +0100
Subject: [PATCH 03/11] lm_sensors-3.0.0-sysconfig_metadata
---
prog/detect/sensors-detect | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index 2018cc70..fed2b3b6 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -7444,6 +7444,12 @@ sub write_config
or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
print SYSCONFIG <<'EOT';
+## Path: Hardware/Sensors
+## Description: Defines the modules to used
+## Type: string
+## ServiceRestart: lm_sensors
+## Default: ""
+#
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
# be loaded/unloaded.
#
--
2.43.0

View File

@ -0,0 +1,44 @@
From c4b5b7114a43b771331a68317c46644aef42ebb5 Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Tue, 14 Oct 2008 14:34:53 +0200
Subject: [PATCH 04/11] lm_sensors-3.0.3-hint-at-kernel-extra-package
---
prog/detect/sensors-detect | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index fed2b3b6..f5b890ba 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -3090,13 +3090,16 @@ sub initialize_conf
# [2] -> SUBLEVEL
# [3] -> EXTRAVERSION
#
-use vars qw($kernel_version @kernel_version $kernel_arch);
+use vars qw($kernel_version @kernel_version $kernel_flavor $kernel_arch);
sub initialize_kernel_version
{
chomp($kernel_version = `uname -r`);
$kernel_version =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
@kernel_version = ($1, $2, $3, $4);
+ if ($kernel_version[3] =~ /-([a-z]+)$/) {
+ chomp($kernel_flavor = $1);
+ }
chomp($kernel_arch = `uname -m`);
# We only support kernels >= 2.6.5
@@ -7389,6 +7392,9 @@ sub generate_modprobes
print "Warning: the required module $driver is not currently installed\n".
"on your system. Check https://hwmon.wiki.kernel.org/device_support_status for\n".
"driver availability.\n\n";
+ print "You may need to install package kernel-$kernel_flavor-extra for\n".
+ "lm-sensors to work properly.\n\n" if $kernel_flavor;
+
} else {
$hwmon_modules{$driver}++
unless hwmon_is_autoloaded($driver);
--
2.43.0

View File

@ -0,0 +1,25 @@
From 00066aab63916e9c5b8aec9f412fd30a7a040563 Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Mon, 20 Jul 2009 09:59:32 +0200
Subject: [PATCH 01/11] lm_sensors-3.1.1-build
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index f1e72258..c2e0615a 100644
--- a/Makefile
+++ b/Makefile
@@ -152,7 +152,7 @@ ifeq ($(DEBUG),1)
ALL_CPPFLAGS += -DDEBUG
ALL_CFLAGS += -O -g
else
-ALL_CFLAGS += -O2
+ALL_CFLAGS += $(RPM_OPT_FLAGS)
endif
ifeq ($(WARN),1)
--
2.43.0

View File

@ -0,0 +1,32 @@
From f3f6488b0b15d1eea89c4312e7dc646e2b959fa5 Mon Sep 17 00:00:00 2001
From: Jean Delvare <jdelvare@suse.de>
Date: Sun, 16 Dec 2018 12:19:48 +0000
Subject: [PATCH 06/11] libsensors: Undo gratuitous library version bump
The new library is compatible with previous versions, it only has
added symbols, no changes nor removals. So the major version number
shall stay the same.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
lib/Module.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Module.mk b/lib/Module.mk
index ca25e7bb..fbc4114f 100644
--- a/lib/Module.mk
+++ b/lib/Module.mk
@@ -32,8 +32,8 @@ LIBMAN5FILES := $(MODULE_DIR)/sensors.conf.5
# The library soname (major number) must be changed if and only if the interface is
# changed in a backward incompatible way. The interface is defined by
# the public header files - in this case they are error.h and sensors.h.
-LIBMAINVER := 5
-LIBMINORVER := 0.0
+LIBMAINVER := 4
+LIBMINORVER := 5.0
LIBVER := $(LIBMAINVER).$(LIBMINORVER)
# The static lib name, the shared lib name, and the internal ('so') name of
--
2.43.0

View File

@ -0,0 +1,35 @@
From: Martin Jambor <mjambor@suse.cz>
Date: Mon, 25 Dec 2023 18:45:35 +0100
Subject: Revert: [PATCH] rrd: drop useless cast
Revert upstream 6b5a19b70867941b3841eb879ebd33e491a67c25
The revert may look useless but prevents buildgint the package with
GCC 14.
---
prog/sensord/rrd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/prog/sensord/rrd.c b/prog/sensord/rrd.c
index a531362bd..263d89fdb 100644
--- b/prog/sensord/rrd.c
+++ a/prog/sensord/rrd.c
@@ -299,7 +299,7 @@
argv[argc++] = rraBuff;
argv[argc] = NULL;
- ret = rrd_create(argc, argv);
+ ret = rrd_create(argc, (char**) argv);
if (ret == -1) {
sensorLog(LOG_ERR, "Error creating RRD file: %s: %s",
sensord_args.rrdFile, rrd_get_error());
@@ -455,7 +455,7 @@
const char *argv[] = {
"sensord", sensord_args.rrdFile, rrdBuff, NULL
};
- if ((ret = rrd_update(3, /* WEAK */ argv))) {
+ if ((ret = rrd_update(3, (char **) /* WEAK */ argv))) {
sensorLog(LOG_ERR, "Error updating RRD file: %s: %s",
sensord_args.rrdFile, rrd_get_error());
}

1233
sensors.changes Normal file

File diff suppressed because it is too large Load Diff

234
sensors.spec Normal file
View File

@ -0,0 +1,234 @@
#
# spec file for package sensors
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
#%%define commit 1c48b191c8a2b9fc747e3db3816247c666c5c3f1
#%%define shortcommit 1c48b19
%define _name lm-sensors
%define _version 3-6-2
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
Name: sensors
Version: %(echo %{_version} | tr '-' '.')
Release: 0
Summary: Hardware health monitoring for Linux
License: GPL-2.0-or-later
Group: System/Monitoring
URL: https://github.com/lm-sensors/%{_name}
Source0: https://github.com/hramrach/%{_name}/archive/V%{_version}.tar.gz#/%{_name}-%{_version}.tar.gz
Source1: sysconfig.sensord
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
Patch8: lm_sensors-3.5.0-libsensors-fix-soname.patch
BuildRequires: bison
BuildRequires: flex
BuildRequires: perl-Test-Cmd
BuildRequires: rrdtool-devel
BuildRequires: systemd-rpm-macros
BuildRequires: valgrind
Requires: modutils
%{?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
%{_sbindir}/sensors-detect. Warning, before using the sensors the default
configuration in %{_sysconfdir}/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!
%package -n sensord
Summary: Hardware health monitoring daemon
License: GPL-2.0-or-later
Group: System/Monitoring
Requires(pre): %fillup_prereq
Provides: sensors:%{_sbindir}/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.
%package -n libsensors4
Summary: Hardware health monitoring library
License: LGPL-2.1-or-later
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.
%package -n libsensors4-devel
Summary: Hardware health monitoring library
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libsensors4 = %{version}
Provides: sensors:%{_includedir}/sensors/sensors.h
%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.
%prep
%autosetup -p1 -n %{_name}-%{_version}
%build
RPM_OPT_FLAGS="%{optflags}"
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=%{buildroot} install
mkdir -p %{buildroot}/%{_docdir}/sensors %{buildroot}/%{_docdir}/sensord
cp -a doc/donations doc/fan-divisors \
doc/fancontrol.txt doc/libsensors-API.txt \
doc/progs doc/temperature-sensors \
doc/vid COPYING COPYING.LGPL %{buildroot}/%{_docdir}/sensors/
cp -a COPYING %{buildroot}/%{_docdir}/sensord/
chmod -R u+rwX,g+rX,o+rX %{buildroot}/%{_docdir}/sensors/ %{buildroot}/%{_docdir}/sensord/
chmod 0755 %{buildroot}/%{_libdir}/libsensors.so.*
mkdir -p %{buildroot}/%{_unitdir} %{buildroot}/%{_fillupdir}
cp -a prog/init/*.service %{buildroot}/%{_unitdir}/
ln -sf service %{buildroot}%{_sbindir}/rclm_sensors
ln -sf service %{buildroot}%{_sbindir}/rcfancontrol
ln -sf service %{buildroot}%{_sbindir}/rcsensord
cp -a %{SOURCE1} %{buildroot}/%{_fillupdir}
%check
make test
%pre
%service_add_pre lm_sensors.service fancontrol.service
%post
sh -c '
CONFIG=%{_sysconfdir}/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 %{_sysconfdir}/modprobe.d/lm_sensors -a ! -e %{_sysconfdir}/modprobe.d/lm_sensors.conf ; then
mv -f %{_sysconfdir}/modprobe.d/lm_sensors %{_sysconfdir}/modprobe.d/lm_sensors.conf
fi
%service_add_post lm_sensors.service fancontrol.service
%preun
%service_del_preun fancontrol.service lm_sensors.service
%postun
%service_del_postun fancontrol.service lm_sensors.service
%pre -n sensord
%service_add_pre sensord.service
%post -n sensord
%service_add_post sensord.service
%{fillup_only -n sensord}
%preun -n sensord
%service_del_preun sensord.service
%postun -n sensord
%service_del_postun sensord.service
%post -n libsensors4 -p /sbin/ldconfig
%postun -n libsensors4 -p /sbin/ldconfig
%files
%{_unitdir}/lm_sensors.service
%{_sbindir}/rclm_sensors
%{_unitdir}/fancontrol.service
%{_sbindir}/rcfancontrol
%{_bindir}/*
%{_sbindir}/fancontrol
%ifarch i386 i486 i586 i686 x86_64
%{_sbindir}/isadump
%{_sbindir}/isaset
%endif
%{_sbindir}/pwmconfig
%{_sbindir}/sensors-detect
%dir %{_docdir}/sensors
%doc %{_docdir}/sensors/donations
%doc %{_docdir}/sensors/fan-divisors
%doc %{_docdir}/sensors/fancontrol.txt
%doc %{_docdir}/sensors/progs
%doc %{_docdir}/sensors/temperature-sensors
%doc %{_docdir}/sensors/vid
%license %{_docdir}/sensors/COPYING
%{_mandir}/man1/*.1%{?ext_man}
%{_mandir}/man8/fancontrol.8%{?ext_man}
%ifarch i386 i486 i586 i686 x86_64
%{_mandir}/man8/isadump.8%{?ext_man}
%{_mandir}/man8/isaset.8%{?ext_man}
%endif
%{_mandir}/man8/pwmconfig.8%{?ext_man}
%{_mandir}/man8/sensors-conf-convert.8%{?ext_man}
%{_mandir}/man8/sensors-detect.8%{?ext_man}
%{_datadir}/zsh/site-functions/
%files -n sensord
%{_unitdir}/sensord.service
%{_sbindir}/rcsensord
%{_fillupdir}/sysconfig.sensord
%{_sbindir}/sensord
%dir %{_docdir}/sensord
%license %{_docdir}/sensord/COPYING
%{_mandir}/man8/sensord.8%{?ext_man}
%files -n libsensors4
%config %{_sysconfdir}/sensors3.conf
%config %{_sysconfdir}/sensors.d/
%{_libdir}/libsensors.so.4*
%dir %{_docdir}/sensors
%license %{_docdir}/sensors/COPYING.LGPL
%{_mandir}/man5/*.5%{?ext_man}
%files -n libsensors4-devel
%{_includedir}/sensors/
%{_libdir}/libsensors.so
%dir %{_docdir}/sensors
%doc %{_docdir}/sensors/libsensors-API.txt
%{_mandir}/man3/*.3%{?ext_man}
%changelog

27
sysconfig.sensord Normal file
View File

@ -0,0 +1,27 @@
## Path: Hardware/Sensors Monitoring Daemon
## Description: Configuration for the hardware sensors monitoring daemon (sensord)
## ServiceRestart: sensord
## Type: string
## Default: "1m"
#
# Interval between scanning for alarms. Use suffix "s" for seconds, "m" for
# minutes, "h" for hours. 0 turns off scanning for alarms.
#
INTERVAL="1m"
## Type: string
## Default: "20m"
#
# Interval between logging. Use suffix "s" for seconds, "m" for minutes, "h"
# for hours. 0 turns off logging.
#
LOG_INTERVAL="20m"
## Type: string
## Default: ""
#
# Pass specific sensord(8) options when the service is started via
# systemctl.
#
SENSORD_ARGS=""