smartmontools-vl.spec 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. %bcond_with systemd
  2. Summary: smartmontools - for monitoring S.M.A.R.T. disks and devices
  3. Summary(ja): smartmontools - S.M.A.R.T.ディスクとデバイスの監視
  4. Name: smartmontools
  5. Version: 7.3
  6. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  7. License: GPLv2+
  8. Group: system
  9. URL: http://smartmontools.sourceforge.net/
  10. Vendor: Project Vine
  11. Distribution: Vine Linux
  12. Source0: http://downloads.sourceforge.net/smartmontools/%{name}-%{version}.tar.gz
  13. Source1: ChangeLog.upstream
  14. Source2: smartmontools.sysconfig
  15. Source3: smartd.init
  16. # https://github.com/smartmontools/smartmontools/raw/master/smartmontools/drivedb.h
  17. Source5: drivedb.h
  18. Patch0: smartmontools-5.42-vinerelease.patch
  19. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  20. Obsoletes: smartctl
  21. Obsoletes: smartd
  22. Obsoletes: ucsc-smartsuite
  23. Obsoletes: smartsuite
  24. Requires: fileutils
  25. BuildRequires: readline-devel ncurses-devel automake util-linux groff gettext
  26. BuildRequires: libcap-ng-devel
  27. %if %{with systemd}
  28. BuildRequires: systemd systemd-devel
  29. %{?systemd_requires}
  30. %else
  31. Requires(post): /sbin/chkconfig
  32. Requires: chkconfig
  33. %endif
  34. #Packager: Bruce Allen <smartmontools-support@lists.sourceforge.net>
  35. # Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net>
  36. # Home page: http://smartmontools.sourceforge.net/
  37. #
  38. # This program is free software; you can redistribute it and/or modify it
  39. # under the terms of the GNU General Public License as published by the Free
  40. # Software Foundation; either version 2, or (at your option) any later
  41. # version.
  42. #
  43. # You should have received a copy of the GNU General Public License (for
  44. # example COPYING); if not, write to the Free Software Foundation, Inc., 675
  45. # Mass Ave, Cambridge, MA 02139, USA.
  46. #
  47. # This code was originally developed as a Senior Thesis by Michael Cornwell
  48. # at the Concurrent Systems Laboratory (now part of the Storage Systems
  49. # Research Center), Jack Baskin School of Engineering, University of
  50. # California, Santa Cruz. http://ssrc.soe.ucsc.edu/
  51. %description
  52. smartmontools controls and monitors storage devices using the
  53. Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.)
  54. built into ATA and SCSI Hard Drives. This is used to check the
  55. reliability of the hard drive and to predict drive failures. The suite
  56. is derived from the smartsuite package, and contains two utilities. The
  57. first, smartctl, is a command line utility designed to perform simple
  58. S.M.A.R.T. tasks. The second, smartd, is a daemon that periodically
  59. monitors smart status and reports errors to syslog. The package is
  60. compatible with the ATA/ATAPI-5 specification. Future releases will be
  61. compatible with the ATA/ATAPI-6 andATA/ATAPI-7 specifications. The
  62. package is intended to incorporate as much "vendor specific" and
  63. "reserved" information as possible about disk drives. man smartctl and
  64. man smartd will provide more information. The most recent versions of
  65. this package and additional information can be found at the URL:
  66. http://smartmontools.sourceforge.net/
  67. %description -l ja
  68. smartmontoolsはATAおよびSCSIハードドライブに組み込まれたSelf-Monitoring,
  69. Analysis and Reporting Technology (S.M.A.R.T.)システムを用いてストレージ
  70. デバイスを制御・監視するツールです。ハードドライブの信頼性を点検し、ドラ
  71. イブの故障を予測するために用いられます。smartmontoolsはsmartsuiteパッケ
  72. ージから派生したもので、2つのユーティリティからなります。1つ目、smartctl
  73. はS.M.A.R.T.タスクを処理するために設計されたコマンドラインユーティリティ
  74. です。2つ目のsmartdは周期的にS.M.A.R.T.状態を監視し、システムログにエラ
  75. ーを出力するデーモンです。このパッケージはATA/ATAPI-5仕様に準拠していま
  76. す。将来のリリースではATA/ATAPI-6およびATA/ATAPI-7仕様にも準拠する予定
  77. です。このパッケージはディスクドライブに関するベンダ特有および予約された
  78. 情報も可能な限り取り扱えることを重視しています。より詳しい情報はman
  79. smartctlおよびman smartdで得られます。最新のバージョン及び追加情報につい
  80. ての情報は次のURLにあります:http://smartmontools.sourceforge.net/
  81. %debug_package
  82. %prep
  83. %setup -q
  84. %patch0 -p0
  85. cp -f %{SOURCE5} .
  86. # fix encoding
  87. for fe in AUTHORS ChangeLog*
  88. do
  89. iconv -f iso-8859-1 -t utf-8 <$fe >$fe.new
  90. touch -r $fe $fe.new
  91. mv -f $fe.new $fe
  92. done
  93. %build
  94. autoreconf -i
  95. %configure \
  96. --without-selinux \
  97. --with-libcap-ng=yes \
  98. %if %{with systemd}
  99. --with-libsystemd \
  100. --with-systemdsystemunitdir=%{_unitdir} \
  101. --with-systemdenvfile=%{_sysconfdir}/sysconfig/%{name} \
  102. %endif
  103. %{nil}
  104. # update SOURCE5 on maintainer's machine prior commiting, there's no internet connection on builders
  105. %make_build update-smart-drivedb
  106. ./update-smart-drivedb -s - -u sf drivedb.h ||:
  107. cp drivedb.h ../drivedb.h ||:
  108. %make_build CXXFLAGS="$RPM_OPT_FLAGS -fpie" LDFLAGS="-pie -Wl,-z,relro,-z,now"
  109. %install
  110. rm -rf %{buildroot}
  111. make DESTDIR=%{buildroot} install
  112. rm -f examplescripts/Makefile*
  113. chmod a-x -R examplescripts/*
  114. rm -rf %{buildroot}/%{_docdir}/%{name}
  115. mkdir -p %{buildroot}/%{_sysconfdir}/smartd_warning.d
  116. %if %{with systemd}
  117. install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/smartmontools
  118. rm -rf %{buildroot}/etc/{rc.d,init.d}
  119. %else
  120. rm -rf %{buildroot}%{_unitdir}
  121. mkdir -p %{buildroot}/etc/rc.d/init.d
  122. install -m755 %{SOURCE3} -p %{buildroot}/etc/rc.d/init.d/smartd
  123. %endif
  124. %clean
  125. rm -rf %{buildroot}
  126. %if !%{with systemd}
  127. %pre
  128. if [ ! -f /etc/smartd.conf ]; then
  129. echo "Note that you can use a configuration file /etc/smartd.conf to control the"
  130. echo "startup behavior of the smartd daemon. See man 8 smartd for details."
  131. fi
  132. # Now see if we should tell user to set service to start on boot
  133. /sbin/chkconfig --list smartd > /dev/null 2> /dev/null
  134. printmessage=$?
  135. if [ $printmessage -ne 0 ] ; then
  136. echo "Run \"/sbin/chkconfig --add smartd\", to start smartd service on system boot"
  137. else
  138. echo "smartd will continue to start up on system boot"
  139. fi
  140. %endif
  141. %post
  142. %if %{with systemd}
  143. %systemd_post smartd.service
  144. %else
  145. # if smartd is already running, restart it with the new daemon
  146. if [ -f /var/lock/subsys/smartd ]; then
  147. /etc/rc.d/init.d/smartd restart 1>&2
  148. echo "Restarted smartd services"
  149. else
  150. # else tell the user how to start it
  151. echo "Run \"/etc/rc.d/init.d/smartd start\" to start smartd service now."
  152. fi
  153. %endif
  154. %preun
  155. %if %{with systemd}
  156. %systemd_preun smartd.service
  157. %else
  158. # if uninstalling the final copy, stop and remove any links
  159. if [ "$1" = "0" -o -x /bin/systemctl ]; then
  160. if [ -f /var/lock/subsys/smartd ]; then
  161. /etc/rc.d/init.d/smartd stop 1>&2
  162. echo "Stopping smartd services"
  163. fi
  164. # see if any links remain, and kill them if they do
  165. /sbin/chkconfig --list smartd > /dev/null 2> /dev/null
  166. notlinked=$?
  167. if [ $notlinked -eq 0 ]; then
  168. /sbin/chkconfig --del smartd
  169. echo "Removing chkconfig links to smartd boot-time startup scripts"
  170. fi
  171. fi
  172. %endif
  173. %if %{with systemd}
  174. %postun
  175. %systemd_postun_with_restart smartd.service
  176. %endif
  177. %files
  178. %defattr(-,root,root)
  179. %license COPYING
  180. %doc AUTHORS ChangeLog* INSTALL NEWS README TODO
  181. %doc smartd.conf examplescripts
  182. %config(noreplace) %{_sysconfdir}/smartd.conf
  183. %dir %{_sysconfdir}/smartd_warning.d
  184. %attr(755,root,root)%{_sysconfdir}/smartd_warning.sh
  185. %attr(755,root,root) %{_sbindir}/smartd
  186. %attr(755,root,root) %{_sbindir}/smartctl
  187. %attr(755,root,root) %{_sbindir}/update-smart-drivedb
  188. %attr(644,root,root) %{_mandir}/man?/*
  189. %{_datadir}/%{name}
  190. %if %{with systemd}
  191. %{_unitdir}/smartd.service
  192. %config(noreplace) %{_sysconfdir}/sysconfig/smartmontools
  193. %else
  194. %attr(755,root,root) /etc/rc.d/init.d/smartd
  195. %endif
  196. # Maintainers / Developers Key:
  197. # [BA] Bruce Allen
  198. # [EB] Erik Inge Bols# [SB] Stanislav Brabec
  199. # [PC] Peter Cassidy
  200. # [CD] Capser Dik
  201. # [CF] Christian Franke
  202. # [GF] Guilhem Fr騷ou
  203. # [DG] Douglas Gilbert
  204. # [GG] Guido Guenther
  205. # [DK] David Kirkby
  206. # [KM] Kai M臾isarai
  207. # [EM] Eduard Martinescu
  208. # [FM] Fr馘駻ic L. W. Meunier
  209. # [KS] Keiji Sawada
  210. # [SS] Sergey Svishchev
  211. # [PW] Phil Williams
  212. %changelog
  213. * Sat Jun 10 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.3-1
  214. - new upstream release.
  215. * Wed Apr 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.1-1
  216. - new upstream release.
  217. - shrank %%changelog: old logs are ChangeLog.upstream.
  218. * Tue Jul 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.5-1
  219. - new upstream release.
  220. * Fri Nov 22 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2-1
  221. - new upstream release.
  222. * Fri Mar 23 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.42-1
  223. - new upstream release; spec revamp
  224. * Tue Aug 4 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.38-2
  225. - spec in UTF-8
  226. * Sun Apr 27 2008 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 5.38-1vl5
  227. - upstream release
  228. * Wed Jan 02 2008 Shu KONNO <owa@bg.wakwak.com> 5.37-0vl2
  229. - rebuilt for VineSeed
  230. * Tue May 29 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 5.37-0vl1
  231. - upstream release
  232. * Thu Jun 1 2006 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 5.36-1vl2
  233. - upstream release
  234. - update Patch0
  235. - delete noreplace attribute from %%config
  236. * Sun Nov 28 2004 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 5.33-1vl2
  237. - add Patch0: smartmontools-vinerelease.patch
  238. check /etc/vine-release in /etc/rc.d/init.d/smartd
  239. * Fri Oct 15 2004 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 5.33-1vl1
  240. - rebuild for VineSeed
  241. - remove warnings about man page on %pre script
  242. - remove distribution-specific macros and scripts
  243. - remove unnecessary %clean script
  244. - remove date macro
  245. - moved install-time "chkconfig --list" from %post to %pre
  246. - add Summary(ja) and description -l ja
  247. - remove Summary and description other than English and Japanese