source: projects/specs/trunk/s/smartmontools/smartmontools-vl.spec @ 12368

Revision 12368, 9.1 KB checked in by tomop, 4 years ago (diff)

updated 5 packages

hddtemp-0.3-0.36.beta15

lshw-B.02.19.2-1

libndp-1.7-1

openssl-1.1.1f-1

smartmontools-7.1-1

Line 
1%bcond_with systemd
2
3Summary:        smartmontools - for monitoring S.M.A.R.T. disks and devices
4Summary(ja):    smartmontools - S.M.A.R.T.ディスクとデバイスの監視
5Name:           smartmontools
6Version:        7.1
7Release:        1%{?_dist_release}%{?with_systemd:.systemd}
8License:        GPLv2+
9Group:          Applications/System
10URL:            http://smartmontools.sourceforge.net/
11Vendor:         Project Vine
12Distribution:   Vine Linux
13
14Source0:        http://downloads.sourceforge.net/smartmontools/%{name}-%{version}.tar.gz
15Source1:        ChangeLog.upstream
16Source2:        smartmontools.sysconfig
17Source3:        smartd.init
18Patch0:         smartmontools-5.42-vinerelease.patch
19BuildRoot:      %{_tmppath}/%{name}-%{version}-root
20Obsoletes:      smartctl
21Obsoletes:      smartd
22Obsoletes:      ucsc-smartsuite
23Obsoletes:      smartsuite
24Requires:       fileutils
25BuildRequires:  readline-devel ncurses-devel automake util-linux groff gettext
26
27%if %{with systemd}
28BuildRequires:  systemd systemd-devel
29%{?systemd_requires}
30%else
31Requires(post): /sbin/chkconfig
32Requires: chkconfig
33%endif
34
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
54smartmontools controls and monitors storage devices using the
55Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.)
56built into ATA and SCSI Hard Drives.  This is used to check the
57reliability of the hard drive and to predict drive failures.  The suite
58is derived from the smartsuite package, and contains two utilities.  The
59first, smartctl, is a command line utility designed to perform simple
60S.M.A.R.T. tasks.  The second, smartd, is a daemon that periodically
61monitors smart status and reports errors to syslog.  The package is
62compatible with the ATA/ATAPI-5 specification.  Future releases will be
63compatible with the ATA/ATAPI-6 andATA/ATAPI-7 specifications.  The
64package is intended to incorporate as much "vendor specific" and
65"reserved" information as possible about disk drives.  man smartctl and
66man smartd will provide more information. The most recent versions of
67this package and additional information can be found at the URL:
68http://smartmontools.sourceforge.net/
69
70%description -l ja
71smartmontoolsはATAおよびSCSIハードドライブに組み込まれたSelf-Monitoring,
72Analysis 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
82smartctlおよびman smartdで得られます。最新のバージョン及び追加情報につい
83ての情報は次のURLにあります:http://smartmontools.sourceforge.net/
84
85
86%prep
87%setup -q
88%patch0 -p0
89
90# fix encoding
91for fe in AUTHORS ChangeLog*
92do
93  iconv -f iso-8859-1 -t utf-8 <$fe >$fe.new
94  touch -r $fe $fe.new
95  mv -f $fe.new $fe
96done
97
98
99%build
100autoreconf -i
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}
109
110%make_build CXXFLAGS="$RPM_OPT_FLAGS -fpie" LDFLAGS="-pie -Wl,-z,relro,-z,now"
111
112
113%install
114rm -rf %{buildroot}
115make DESTDIR=%{buildroot} install
116
117rm -f examplescripts/Makefile*
118chmod a-x -R examplescripts/*
119
120rm -rf %{buildroot}/%{_docdir}/%{name}
121
122mkdir -p %{buildroot}/%{_sysconfdir}/smartd_warning.d
123
124%if %{with systemd}
125install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/smartmontools
126rm -rf %{buildroot}/etc/{rc.d,init.d}
127%else
128rm -rf %{buildroot}%{_unitdir}
129mkdir -p %{buildroot}/etc/rc.d/init.d
130install -m755 %{SOURCE3} -p %{buildroot}/etc/rc.d/init.d/smartd
131%endif
132
133
134%clean
135rm -rf %{buildroot}
136
137%if !%{with systemd}
138%pre
139if [ ! -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."
142fi
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
146printmessage=$?
147
148if [ $printmessage -ne 0 ] ; then
149        echo "Run \"/sbin/chkconfig --add smartd\", to start smartd service on system boot"
150else
151        echo "smartd will continue to start up on system boot"
152fi
153%endif
154
155%post
156%if %{with systemd}
157%systemd_post smartd.service
158%else
159# if smartd is already running, restart it with the new daemon
160if [ -f /var/lock/subsys/smartd ]; then
161        /etc/rc.d/init.d/smartd restart 1>&2
162        echo "Restarted smartd services"
163else
164# else tell the user how to start it
165        echo "Run \"/etc/rc.d/init.d/smartd start\" to start smartd service now."
166fi
167%endif
168
169%preun
170%if %{with systemd}
171%systemd_preun smartd.service%else
172# if uninstalling the final copy, stop and remove any links     
173if [ "$1" = "0" -o -x /bin/systemctl ]; then
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
187fi
188%endif
189
190%if %{with systemd}
191%postun
192%systemd_postun_with_restart smartd.service
193%endif
194
195%files
196%defattr(-,root,root)
197%license COPYING
198%doc AUTHORS ChangeLog* INSTALL NEWS README TODO
199%doc smartd.conf examplescripts
200%config(noreplace) %{_sysconfdir}/smartd.conf
201%dir %{_sysconfdir}/smartd_warning.d
202%attr(755,root,root)%{_sysconfdir}/smartd_warning.sh
203%attr(755,root,root) %{_sbindir}/smartd
204%attr(755,root,root) %{_sbindir}/smartctl
205%attr(755,root,root) %{_sbindir}/update-smart-drivedb
206%attr(644,root,root) %{_mandir}/man?/*
207%{_datadir}/%{name}
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
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
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
237* Tue Jul  5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.5-1
238- new upstream release.
239
240* Fri Nov 22 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2-1
241- new upstream release.
242
243* Fri Mar 23 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.42-1
244- new upstream release; spec revamp
245
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
Note: See TracBrowser for help on using the repository browser.