From c4cbeb9679609207db122e711a2b62f8023ff5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mr=C3=A1z?= Date: Thu, 3 Nov 2005 17:06:22 +0000 Subject: [PATCH] - Spec file cleanup by Robert Scheck (#170959) - manual release numbering - remove bogus patch of non-installed file - only non-removable drives should be added to smartd.conf - smartd.conf should be owned (#171498) --- smartd-conf.py | 4 ++- smartmontools.spec | 66 ++++++++++++++++++++++------------------------ 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/smartd-conf.py b/smartd-conf.py index dc37e1f..9f9efe7 100755 --- a/smartd-conf.py +++ b/smartd-conf.py @@ -35,7 +35,9 @@ print """# /etc/smartd.conf # But send an email in this case""" for drive in drives: - print "/dev/%s -H -m root@localhost" % drive.device + fh=open("/sys/block/%s/removable" % drive.device) + if fh.read(1) == '0': + print "/dev/%s -H -m root@localhost" % drive.device print """ # First two SCSI disks. This will monitor everything that smartd can diff --git a/smartmontools.spec b/smartmontools.spec index f83531e..b6b400c 100644 --- a/smartmontools.spec +++ b/smartmontools.spec @@ -1,22 +1,21 @@ -Summary: Tools for monitoring SMART capable hard disks. +Summary: Tools for monitoring SMART capable hard disks Name: smartmontools Version: 5.33 -Release: %(R="$Revision: 1.8 $"; RR="${R##: }"; echo ${RR%%?}) +Release: 2 Epoch: 1 Group: System Environment/Base License: GPL -Source0: smartmontools-%{version}.tar.gz +URL: http://smartmontools.sourceforge.net/ +Source0: http://dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz Source1: smartd.initd Source2: smartd-conf.py -Buildroot: %{_tmppath}/%{name}-%{version}-root -Prereq: /sbin/chkconfig /sbin/service +BuildRoot: %{_tmppath}/%{name}-%{version}-root +PreReq: /sbin/chkconfig /sbin/service Requires: fileutils kudzu -BuildPreReq: readline-devel ncurses-devel /usr/bin/aclocal /usr/bin/automake /usr/bin/autoconf util-linux groff gettext +BuildRequires: readline-devel ncurses-devel /usr/bin/aclocal /usr/bin/automake /usr/bin/autoconf util-linux groff gettext Obsoletes: kernel-utils ExclusiveArch: i386 x86_64 ia64 ppc ppc64 -Patch1: smartmontools-smartd.patch - %description The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self- @@ -25,45 +24,35 @@ into most modern ATA and SCSI hard disks. In many cases, these utilities will provide advanced warning of disk degradation and failure. - %prep -%setup -q -c -a 0 -%patch1 -p0 +%setup -q %build -rm -rf $RPM_BUILD_ROOT - -mkdir -p %{buildroot}/usr/sbin -mkdir -p %{buildroot}/usr/man -mkdir -p %{buildroot}/etc/rc.d/init.d -mkdir -p %{buildroot}/etc/sysconfig - -cd smartmontools-%{version} %configure -make CFLAGS="$RPM_OPT_FLAGS -fpie -pie -Wl,-z,relro,-z,now" DESTDIR=$RPM_BUILD_ROOT smartd smartctl install +make CFLAGS="$RPM_OPT_FLAGS -fpie" LDFLAGS="-pie -Wl,-z,relro,-z,now" %install -mkdir -p %{buildroot}/usr/share/man/man{1,8} +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install -cd smartmontools-%{version} -rm -f %{buildroot}/etc/smartd.conf -rm -f %{buildroot}/etc/rc.d/init.d/smartd.conf -install %{SOURCE1} %{buildroot}/etc/rc.d/init.d/smartd -install %{SOURCE2} %{buildroot}/usr/sbin/smartd-conf.py - -chmod -R a-s %{buildroot} +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/smartd.conf +rm -f examplescripts/Makefile* +install -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/smartd +install -D -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sbindir}/smartd-conf.py %clean -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; +rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%attr(0644,root,root) %{_mandir}/*/* -/usr/sbin/smartd -/usr/sbin/smartctl -/usr/sbin/smartd-conf.py* -/etc/rc.d/init.d/smartd -%doc /usr/share/doc/smartmontools-%{version} +%doc AUTHORS CHANGELOG COPYING INSTALL NEWS README +%doc TODO WARNINGS examplescripts smartd.conf +%{_sbindir}/smartd +%{_sbindir}/smartctl +%{_sbindir}/smartd-conf.py* +%{_sysconfdir}/rc.d/init.d/smartd +%{_mandir}/man?/smart*.* +%ghost %verify(not md5 size mtime) %config(noreplace,missingok) %{_sysconfdir}/smartd.conf %preun if [ "$1" = "0" ] ; then @@ -80,6 +69,13 @@ exit 0 %changelog +* Thu Nov 3 2005 Tomas Mraz 1:5.33-2 +- Spec file cleanup by Robert Scheck (#170959) +- manual release numbering +- remove bogus patch of non-installed file +- only non-removable drives should be added to smartd.conf +- smartd.conf should be owned (#171498) + * Tue Oct 25 2005 Dave Jones - Add comments to generated smartd.conf (#135397)