lm-sensors-vl.spec 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. %bcond_with systemd
  2. Summary: Hardware monitoring tools
  3. Summary(ja): ハードウェア監視ツール集
  4. Name: lm-sensors
  5. Version: 3.6.0
  6. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  7. Group: system
  8. Vendor: Project Vine
  9. Distribution: Vine Linux
  10. Packager: shaolin, owa
  11. %global ver_str %(echo -n "%{version}" | sed -e 's/\\./-/g')
  12. License: LGPLv2+ and GPLv3+ and GPLv2+ and Verbatim and Public Domain
  13. URL: https://github.com/lm-sensors/lm-sensors
  14. Source0: https://github.com/lm-sensors/lm-sensors/archive/V%{ver_str}/lm-sensors-%{ver_str}.tar.gz
  15. Source1: lm_sensors.sysconfig
  16. # This one was taken from PLD-linux, Thanks!
  17. Source2: sensord.sysconfig
  18. Source3: lm_sensors-modprobe-wrapper
  19. Source4: lm_sensors-modprobe-r-wrapper
  20. Source5: sensord.service
  21. Source6: sensord-service-wrapper
  22. Source7: lm_sensors.service
  23. Source8: lm_sensors-wrapper
  24. # Upstream patch:
  25. Patch1: 0001-Change-PIDFile-path-from-var-run-to-run.patch
  26. Patch2: lm_sensors-3.6.0-allow_no_sensors.patch
  27. # Upstream commit 5deee7d0c301df779:
  28. Patch3: lm_sensors-3.6.0-sensors-detect-Add-support-for-AMD-CPU-Family-19h.patch
  29. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  30. BuildRequires: bison
  31. BuildRequires: flex
  32. BuildRequires: gawk
  33. BuildRequires: kernel-headers >= 2.2.16
  34. %if "%{_dist_release}" >= "vl7"
  35. BuildRequires: libsysfs-devel
  36. %else
  37. BuildRequires: sysfsutils-devel
  38. %endif
  39. BuildRequires: rrdtool-devel
  40. Requires: perl
  41. %if %{with systemd}
  42. %else
  43. Requires: initscripts
  44. Requires(post): /sbin/chkconfig
  45. Requires(preun): /sbin/chkconfig
  46. %endif
  47. %description
  48. The lm-sensors package includes a collection of modules for general SMBus
  49. access and hardware monitoring.
  50. %package libs
  51. Summary: Lm_sensors core libraries
  52. Summary(ja): Lm_sensors コアライブラリ
  53. Group: system
  54. %description libs
  55. Core libraries for lm_sensors applications
  56. %package devel
  57. Summary: Development files for programs which will use lm_sensors
  58. Summary(ja): lm_sensors を使用するプログラムのための開発用ファイル
  59. Group: programming
  60. Requires: %{name}-libs = %{version}-%{release}
  61. %description devel
  62. The %{name}-devel package includes a header files and libraries for use
  63. when building applications that make use of sensor data.
  64. %package sensord
  65. Summary: Daemon that periodically logs sensor readings
  66. Summary(ja): センサーの読み取り値を定期的に記録するデーモン
  67. Group: system
  68. Requires: %{name} = %{version}-%{release}
  69. %description sensord
  70. Daemon that periodically logs sensor readings to syslog or a round-robin
  71. database, and warns of sensor alarms.
  72. %debug_package
  73. %prep
  74. %setup -q -n lm-sensors-%{ver_str}
  75. %patch1 -p1
  76. %patch2 -p1
  77. %patch3 -p1
  78. # Remove currently unused files to make sure we've got the license right
  79. rm -f prog/init/sysconfig-lm_sensors-convert prog/hotplug/unhide_ICH_SMBus
  80. mv prog/init/README prog/init/README.initscripts
  81. chmod -x prog/init/fancontrol.init
  82. # fixing the sensord-service-wrapper path
  83. cp -p %{SOURCE5} sensord.service
  84. cp -p %{SOURCE7} lm_sensors.service
  85. sed -i "s|\@WRAPPER_DIR\@|%{_libexecdir}/%{name}|" sensord.service
  86. sed -i "s|\@WRAPPER_DIR\@|%{_libexecdir}/%{name}|" lm_sensors.service
  87. %build
  88. %set_build_flags
  89. make PREFIX=%{_prefix} LIBDIR=%{_libdir} MANDIR=%{_mandir} \
  90. EXLDFLAGS="$LDFLAGS" PROG_EXTRA=sensord BUILD_STATIC_LIB=0 user
  91. %install
  92. rm -rf %{buildroot}
  93. make user_install \
  94. DESTDIR=%{buildroot} \
  95. PREFIX=%{_prefix} \
  96. LIBDIR=%{_libdir} \
  97. ETCDIR=%{_sysconfdir} \
  98. MANDIR=%{_mandir} \
  99. PROG_EXTRA=sensord \
  100. BUILD_STATIC_LIB=0 \
  101. user_install
  102. ln -s sensors.conf.5.gz %{buildroot}%{_mandir}/man5/sensors3.conf.5.gz
  103. # add initscript from proc/init
  104. mkdir -p %{buildroot}%{_sysconfdir}/sensors.d
  105. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  106. install -pm 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/lm_sensors
  107. %if %{with systemd}
  108. install -pm 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/sensord
  109. # service files
  110. mkdir -p %{buildroot}%{_unitdir}
  111. install -pm 644 prog/init/fancontrol.service %{buildroot}%{_unitdir}
  112. install -pm 644 lm_sensors.service %{buildroot}%{_unitdir}
  113. install -pm 644 sensord.service %{buildroot}%{_unitdir}
  114. # customized modprobe calls
  115. mkdir -p %{buildroot}%{_libexecdir}/%{name}
  116. install -pm 755 %{SOURCE3} %{buildroot}%{_libexecdir}/%{name}/lm_sensors-modprobe-wrapper
  117. install -pm 755 %{SOURCE4} %{buildroot}%{_libexecdir}/%{name}/lm_sensors-modprobe-r-wrapper
  118. install -pm 755 %{SOURCE8} %{buildroot}%{_libexecdir}/%{name}/lm_sensors-wrapper
  119. # sensord service wrapper
  120. install -pm 755 %{SOURCE6} %{buildroot}%{_libexecdir}/%{name}/sensord-service-wrapper
  121. %else
  122. mkdir -p %{buildroot}%{_initdir}
  123. install -m755 prog/init/lm_sensors.init %{buildroot}%{_initdir}/lm_sensors
  124. %endif
  125. # remove unuse files
  126. rm -f %{buildroot}/%{_libdir}/*.a
  127. %clean
  128. rm -rf %{buildroot}
  129. %post
  130. %if %{with systemd}
  131. %systemd_post lm_sensors.service
  132. %else
  133. if [ "$1" = 1 ] ; then
  134. /sbin/chkconfig --add lm_sensors
  135. fi
  136. %{_initdir}/lm_sensors condrestart
  137. %endif
  138. %preun
  139. %if %{with systemd}
  140. %systemd_preun lm_sensors.service
  141. %else
  142. if [ "$1" = 0 ] ; then
  143. %{_initdir}/lm_sensors stop > /dev/null 2>&1
  144. /sbin/chkconfig --del lm_sensors
  145. fi
  146. %endif
  147. %if %{with systemd}
  148. %postun
  149. %systemd_postun_with_restart lm_sensors.service
  150. %post sensord
  151. %systemd_post sensord.service
  152. %preun sensord
  153. %systemd_preun sensord.service
  154. %postun sensord
  155. %systemd_postun_with_restart sensord.service
  156. %endif
  157. %files
  158. %defattr(-,root,root,-)
  159. %license COPYING
  160. %doc CHANGES CONTRIBUTORS INSTALL README doc
  161. %dir %{_sysconfdir}/sensors.d
  162. %config(noreplace) %{_sysconfdir}/sensors3.conf
  163. %config(noreplace) %{_sysconfdir}/sysconfig/lm_sensors
  164. %{_bindir}/*
  165. %{_sbindir}/*
  166. %if %{with systemd}
  167. %dir %{_libexecdir}/%{name}
  168. %{_libexecdir}/%{name}/lm_sensors-modprobe*wrapper
  169. %{_libexecdir}/%{name}/lm_sensors-wrapper
  170. %{_unitdir}/lm_sensors.service
  171. %{_unitdir}/fancontrol.service
  172. %else
  173. %config %{_initdir}/lm_sensors
  174. %endif
  175. %{_mandir}/man1/*
  176. %{_mandir}/man5/*
  177. %{_mandir}/man8/*
  178. %exclude %{_sbindir}/sensord
  179. %exclude %{_mandir}/man8/sensord.8.gz
  180. %files libs
  181. %{_libdir}/lib*.so.*
  182. %files devel
  183. %{_includedir}/sensors
  184. %{_libdir}/lib*.so
  185. %{_mandir}/man3/*
  186. %if %{with systemd}
  187. %files sensord
  188. %doc prog/sensord/README
  189. %{_sbindir}/sensord
  190. %{_mandir}/man8/sensord.8.gz
  191. %config(noreplace) %{_sysconfdir}/sysconfig/sensord
  192. %{_unitdir}/sensord.service
  193. %{_libexecdir}/%{name}/sensord-service-wrapper
  194. %endif
  195. %changelog
  196. * Mon May 29 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.6.0-1
  197. - updated to 3.6.0.
  198. * Fri May 10 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.0-1
  199. - updated to 3.5.0.
  200. * Sat Nov 7 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 3.4.0-1
  201. - update to 3.4.0
  202. * Mon Jan 5 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.3.5-1
  203. - updated to 3.3.5
  204. - built on current VineSeed
  205. - split libraries to libs subpackage
  206. * Tue Apr 12 2011 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 3.3.0-1
  207. - new upstrem release 3.3.0
  208. * Tue Dec 14 2010 Shu KONNO <owa@bg.wakwak.com> 3.2.0-1
  209. - updated lm-sensors to 3.2.0
  210. - added RQ: initscripts
  211. * Tue Mar 16 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
  212. - updated lm-sensors to 3.1.2
  213. * Tue Oct 20 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.1.1-2
  214. - isadump/isaset only available on ix86/x86_64 archs
  215. * Mon Aug 31 2009 Shu KONNO <owa@bg.wakwak.com> 3.1.1-1
  216. - updated lm-sensors to 3.1.1
  217. - added japanese summary, spec in utf-8
  218. - added %{_initdir}/lm_sensors to %%files
  219. - added %%post, %%preun, %%postun scripts
  220. * Fri Oct 03 2008 Shu KONNO <owa@bg.wakwak.com> 2.10.7-1vl5
  221. - new upstream release
  222. - applied new versioning policy
  223. * Sun Nov 25 2007 Shu KONNO <owa@bg.wakwak.com> - 2.10.3-0vl2
  224. - fixed libdir in Makefile (for support lib64)
  225. * Tue May 29 2007 USAMI Kosuke <usami-k@yc5.so-net.ne.jp> - 2.10.3-0vl1
  226. - Initial build.