Clean up the spec file:

* Update Url to new location
* Fix Source0 download link
* Add missing Requires on aaa_base for /sbin/service
* Drop stray Conflicts
* Provide rc links for fancontrol and sensord services
* Add %pre and %post scriptlets for lm_sensors service
* Add all scriptlets for fancontrol service

OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=103
This commit is contained in:
Jean Delvare 2018-12-17 07:33:06 +00:00 committed by Git OBS Bridge
parent 0a5d5b6cb6
commit 58ccf8294d

View File

@ -30,8 +30,8 @@ Release: 0
Summary: Hardware health monitoring for Linux
License: GPL-2.0-or-later
Group: System/Monitoring
Url: https://github.com/groeck/lm-sensors
Source0: https://github.com/lm-sensors/lm-sensors/%{_name}/archive/%{_version}.tar.gz#/%{_name}-%{_version}.tar.gz
Url: https://github.com/lm-sensors/%{_name}
Source0: https://github.com/lm-sensors/%{_name}/archive/V%{_version}.tar.gz#/%{_name}-%{_version}.tar.gz
#Source0: https://github.com/groeck/lm-sensors/archive/%%{commit}/%%{_name}-%%{shortcommit}.tar.gz
Source1: sysconfig.sensord
Source2: baselibs.conf
@ -49,6 +49,7 @@ BuildRequires: bison
BuildRequires: flex
BuildRequires: rrdtool-devel
BuildRequires: systemd-rpm-macros
Requires: aaa_base
Requires: modutils
ExcludeArch: s390 s390x
%{?systemd_requires}
@ -94,7 +95,6 @@ License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libsensors4 = %{version}
Conflicts: libsensors4-devel
Provides: sensors:%{_includedir}/sensors/sensors.h
%description -n libsensors4-devel
@ -132,7 +132,9 @@ make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} M
chmod 0755 %{buildroot}/%{_libdir}/libsensors.so.*
mkdir -p %{buildroot}/%{_unitdir} %{buildroot}/%{_fillupdir}
cp -a prog/init/*.service %{buildroot}/%{_unitdir}/
ln -sf /sbin/service %{buildroot}%{_sbindir}/rclm_sensors
ln -sf /sbin/service %{buildroot}%{_sbindir}/rclm_sensors
ln -sf /sbin/service %{buildroot}%{_sbindir}/rcfancontrol
ln -sf /sbin/service %{buildroot}%{_sbindir}/rcsensord
cp -a %{SOURCE1} %{buildroot}/%{_fillupdir}
%pre
@ -163,10 +165,20 @@ if test -e %{_sysconfdir}/modprobe.d/lm_sensors -a ! -e %{_sysconfdir}/modprobe.
mv -f %{_sysconfdir}/modprobe.d/lm_sensors %{_sysconfdir}/modprobe.d/lm_sensors.conf
fi
%pre
%service_del_pre lm_sensors.service
%service_del_pre fancontrol.service
%post
%service_del_post lm_sensors.service
%service_del_post fancontrol.service
%preun
%service_del_preun fancontrol.service
%service_del_preun lm_sensors.service
%postun
%service_del_postun fancontrol.service
%service_del_postun lm_sensors.service
%pre -n sensord
@ -191,6 +203,7 @@ fi
%{_unitdir}/lm_sensors.service
%{_sbindir}/rclm_sensors
%{_unitdir}/fancontrol.service
%{_sbindir}/rcfancontrol
%{_bindir}/*
%{_sbindir}/fancontrol
%ifarch i386 i486 i586 i686 x86_64
@ -220,6 +233,7 @@ fi
%files -n sensord
%defattr(-,root,root)
%{_unitdir}/sensord.service
%{_sbindir}/rcsensord
%{_fillupdir}/sysconfig.sensord
%{_sbindir}/sensord
%dir %{_docdir}/sensord