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