1 Star 0 Fork 15

konglidong/lm_sensors

forked from src-openEuler/lm_sensors 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
lm_sensors.spec 6.92 KB
一键复制 编辑 原始数据 按行查看 历史
konglidong 提交于 2023-11-08 14:27 . amend fix no sensors failure in vm
%define git_version %(echo %{version} |sed -e 's/\\./-/g')
Name: lm_sensors
Version: 3.6.0
Release: 8
Summary: Linux-monitoring sensors
# lib/libsensors.3 is licensed Verbatim
# dist-git files are licensed MIT
# and others are licensed by GPLv2+ or LGPLv2+
License: LGPLv2+ and GPLv2+ and Verbatim and MIT
URL: http://github.com/lm-sensors/lm-sensors
#from https://github.com/lm-sensors/lm-sensors/archive/V%{git_version}/lm-sensors-%{git_version}.tar.gz
Source0: https://github.com/lm-sensors/lm-sensors/archive/V%{git_version}/lm-sensors-%{git_version}.tar.gz
Source1: lm_sensors.sysconfig
Source2: sensord.sysconfig
Source3: lm_sensors-modprobe-wrapper
Source4: lm_sensors-modprobe-r-wrapper
Source5: sensord.service
Source6: sensord-service-wrapper
Source7: lm_sensors.service
Source8: lm_sensors-wrapper
#Upstream patch for fixing no sensors failure in vm
Patch0: lm_sensors-3.6.0-allow_no_sensors.patch
Requires: kmod, systemd-units
BuildRequires: kernel-headers >= 2.2.16, bison, libsysfs-devel, flex, gawk
BuildRequires: perl-generators, rrdtool-devel, gcc
Provides: %{name}-libs
Obsoletes: %{name}-libs
%description
lm_sensors (Linux-monitoring sensors), is a free open source software-tool for Linux
that provides tools and drivers for monitoring temperatures, voltage,
humidity, and fans. It can also detect chassis intrusions.
%package devel
Summary: lm_sensors's development files
Requires: %{name}-libs = %{version}-%{release}
#only lib/libsensors.3 is licensed Verbatim.
License: LGPLv2+ and Verbatim
%description 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.
%package sensord
Summary: hardware health monitoring daemon
Requires: %{name} = %{version}-%{release}
# only prog/sensord/sensord.8 is licensed Verbatim.
# dist-git files are licensed MIT.
License: GPLv2+ and Verbatim and MIT
%description sensord
Daemon that periodically logs sensor readings to syslog or a round-robin
database, and warns of sensor alarms.
%package help
Summary: Help information for user
%description help
Help information for user
%prep
%autosetup -n lm-sensors-%{git_version} -p1
rm -f prog/init/sysconfig-lm_sensors-convert prog/hotplug/unhide_ICH_SMBus
mv prog/init/README prog/init/README.initscripts
chmod -x prog/init/fancontrol.init
cp -p %{SOURCE5} sensord.service
cp -p %{SOURCE7} lm_sensors.service
sed -i "s|\@WRAPPER_DIR\@|%{_libexecdir}/%{name}|" sensord.service
sed -i "s|\@WRAPPER_DIR\@|%{_libexecdir}/%{name}|" lm_sensors.service
sed -i 's|CC := gcc|CC ?= gcc|' Makefile
%build
%set_build_flags
%make_build PREFIX=%{_prefix} LIBDIR=%{_libdir} MANDIR=%{_mandir} \
EXLDFLAGS="$LDFLAGS" PROG_EXTRA=sensord BUILD_STATIC_LIB=0 user
%install
%make_build PREFIX=%{_prefix} LIBDIR=%{_libdir} MANDIR=%{_mandir} PROG_EXTRA=sensord \
DESTDIR=$RPM_BUILD_ROOT BUILD_STATIC_LIB=0 user_install
ln -s sensors.conf.5.gz $RPM_BUILD_ROOT%{_mandir}/man5/sensors3.conf.5.gz
mkdir -p -m 755 $RPM_BUILD_ROOT%{_initrddir}
mkdir -p -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/sensors.d
mkdir -p -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lm_sensors
install -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/sensord
# service files
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 prog/init/fancontrol.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 lm_sensors.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 sensord.service $RPM_BUILD_ROOT%{_unitdir}
# customized modprobe calls
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/%{name}
install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/lm_sensors-modprobe-wrapper
install -pm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/lm_sensors-modprobe-r-wrapper
install -pm 755 %{SOURCE8} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/lm_sensors-wrapper
# sensord service wrapper
install -pm 755 %{SOURCE6} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/sensord-service-wrapper
# Note non standard systemd scriptlets, since reload / stop makes no sense
# for lm_sensors
%triggerun -- lm_sensors < 3.3.0-2
if [ -L /etc/rc3.d/S26lm_sensors ]; then
/bin/systemctl enable lm_sensors.service >/dev/null 2>&1 || :
fi
/sbin/chkconfig --del lm_sensors
# ===== main =====
%post
%systemd_post lm_sensors.service
%preun
%systemd_preun lm_sensors.service
%postun
%systemd_postun_with_restart lm_sensors.service
# ==== sensord ===
%post sensord
%systemd_post sensord.service
%preun sensord
%systemd_preun sensord.service
%postun sensord
%systemd_postun_with_restart sensord.service
# ===== libs =====
%ldconfig_scriptlets
%files
%doc CHANGES CONTRIBUTORS doc README*
%doc prog/init/fancontrol.init prog/init/README.initscripts
%license COPYING COPYING.LGPL
%config %{_sysconfdir}/sensors3.conf
%config %{_sysconfdir}/sysconfig/lm_sensors
%dir %{_sysconfdir}/sensors.d
%{_bindir}/*
%{_sbindir}/*
%{_unitdir}/lm_sensors.service
%{_unitdir}/fancontrol.service
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/lm_sensors-modprobe*wrapper
%{_libexecdir}/%{name}/lm_sensors-wrapper
%{_libdir}/*.so.*
%exclude %{_sbindir}/sensord
%files devel
%{_includedir}/sensors
%{_libdir}/lib*.so
%files sensord
%doc prog/sensord/README
%config(noreplace) %{_sysconfdir}/sysconfig/sensord
%{_sbindir}/sensord
%{_unitdir}/sensord.service
%{_libexecdir}/%{name}/sensord-service-wrapper
%files help
%{_mandir}/man*
%exclude %{_mandir}/man8/sensord.8.gz
%changelog
* Wed Nov 08 2023 konglidong <konglidong@uniontech.com> - 3.6.0-8
- amend fix no sensors failure in vm
* Mon Sep 11 2023 wangxiaomeng <wangxiaomeng@kylinos.cn> - 3.6.0-7
- backport upstraem patch to fix no sensors failure in vm
* Sun Apr 23 2023 liweiganga <liweiganga@uniontech.com> - 3.6.0-6
- add llvm compile support
* Sat Sep 19 2020 xinghe <xinghe1@huawei.com> - 3.6.0-5
- fix uninstall failure
* Fri Sep 04 2020 xinghe <xinghe1@huawei.com> - 3.6.0-4
- fix source0 download
* Fri May 29 2020 Chunsheng Luo <luochunsheng@huawei.com> - 3.6.0-3
- delete "Include previous ABI version for temporary binary compatibility"
* Fri May 22 2020 Chunsheng Luo <luochunsheng@huawei.com> - 3.6.0-2
- fix lm_sensors-modprobe-r-wrapper/lm_sensors-modprobe-wrapper scripts
* Thu May 21 2020 Chunsheng Luo <luochunsheng@huawei.com> - 3.6.0-1
- update to version 3.6.0
* Thu Jan 16 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.4.0-21
- revert package and turn off service file
* Mon Dec 30 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.4.0-20
- update spec
* Thu Dec 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.4.0-19
- Fix upgrade problem
* Tue Apr 16 2019 yuejiayan<yuejiayan@huawei.com> - 3.4.0-18
- Type:bugfix
- ID:NA
- SUG:NA
DESC:pwmconfig: Fix a sed expression
* Mon Apr 1 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.4.0-17
- Package init
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/konglidong/lm_sensors.git
git@gitee.com:konglidong/lm_sensors.git
konglidong
lm_sensors
lm_sensors
master

搜索帮助