smartmontools-vl.spec 9.1 KB

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