Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.2:Update
smartmontools
smartmontools.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File smartmontools.spec of Package smartmontools
# # spec file for package smartmontools (Version 5.38.0.20090808) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: smartmontools License: GPL v2 or later Group: Hardware/Other Version: 5.38.0.20090808 Release: 1 #Source: %{name}-%{version}.tar.bz2 Source: %{name}-svn2872.tar.bz2 Source1: README.SATA Source2: smartmontools.sysconfig Patch: smartmontools-powersave-notify.patch Patch1: smartmontools-default-enabled.patch Patch2: smartmontools-lsb-init-script.patch Patch4: smartmontools-removable.patch Patch5: smartmontools-init-update.patch Patch6: smartmontools-sysconfig.patch Patch7: smartmontools-strict-aliasing.patch PreReq: %insserv_prereq %fillup_prereq coreutils %if %suse_version <= 1100 Requires: powersave %endif %if %suse_version > 1020 Requires: licenses BuildRequires: licenses %endif Url: http://smartmontools.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: gcc-c++ libstdc++-devel %if %suse_version >= 1110 BuildRequires: libselinux-devel %endif Summary: Monitor for S.M.A.R.T. Disks and Devices Obsoletes: smartctl smartd ucsc-smartsuite smartsuite %description SMARTmontools controls and monitors storage devices using the Self-Monitoring, Analysis, and Reporting Technology System (S.M.A.R.T.) built into ATA, SATA and SCSI Hard Drives. This is used to check the hard drive reliability and to predict drive failures. The suite contains two utilities. The first, smartctl, is a command line utility designed to perform simple S.M.A.R.T. tasks. The second, smartd, is a daemon that periodically monitors the smart status and reports errors to syslog. The package is compatible with the ATA/ATAPI-3 to -7 specification. The package is intended to incorporate as much "vendor specific" and "reserved" information as possible about disk drives. The commands man smartctl and man smartd will provide more information. Authors: -------- Bruce Allen <smartmontools-support@lists.sourceforge.net> %prep %setup -q -n %{name} cp -a %{S:1} . cp -a %{S:2} . %if %suse_version >= 1010 %patch1 %endif %patch2 %patch4 %if %suse_version <= 1100 # Powersave notification was available only in 10.0-11.0 and SLE10. %patch %endif %patch5 %patch6 %patch7 %build AUTOMAKE=/usr/bin/automake-1.11 ./autogen.sh export CFLAGS="$RPM_OPT_FLAGS -fPIE" export CXXFLAGS="$RPM_OPT_FLAGS -fPIE" export LDFLAGS="-pie" %configure\ --with-docdir=%{_defaultdocdir}/%{name}\ %if %suse_version >= 1110 --with-selinux\ %endif --enable-drivedb\ --enable-savestates make %{?jobs:-j%jobs} BUILD_INFO='"(openSUSE RPM)"' %install %makeinstall mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d cp smartd.initd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/smartd chmod +x $RPM_BUILD_ROOT%{_sysconfdir}/init.d/smartd ln -s ../..%{_sysconfdir}/init.d/smartd $RPM_BUILD_ROOT%{_sbindir}/rcsmartd %if %suse_version <= 1100 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/smartmontools cp examplescripts/Example4 $RPM_BUILD_ROOT%{_prefix}/lib/smartmontools/smart-notify chmod +x $RPM_BUILD_ROOT%{_prefix}/lib/smartmontools/smart-notify %endif mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates cp smartmontools.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.smartmontools %if %suse_version < 1010 cp README.SATA $RPM_BUILD_ROOT%{_datadir}/doc/packages/%{name}/ %endif mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/smartmontools #remove installed files we don't want to package rm -r $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ %if %suse_version > 1020 ln -sf %{_datadir}/doc/licenses/md5/$(md5sum COPYING | sed 's/ .*//') $RPM_BUILD_ROOT%{_docdir}/%{name}/COPYING %endif cat >$RPM_BUILD_ROOT%{_sysconfdir}/smart_drivedb.h <<EOF /* smart_drivedb.h: Custom drive database. See also %{_datadir}/smartmontools/drivedb.h. */ EOF %clean rm -rf $RPM_BUILD_ROOT %pre # Older SuSE versions (<=10.2) don't do restart on update. Test it and set flag. # This file exists since smartmontools-5.37: if ! test -f usr/share/doc/packages/smartmontools/examplescripts/Example4 ; then touch var/adm/smartd_needs_restart fi %post # Migrate %{_sysconfdir}/default/smartmontools to sysconfig (<=11.0,>=10.2,upstream) #BEGIN smartd_opts_migrate # generated by genopts function optarg_parse() { OPTARG_INTERVAL=false OPTARG_LOGFACILITY=false until [ $# -eq 0 ] do case "$1" in --interval ) shift OPTARG_INTERVAL=true OPTVAL_INTERVAL="$1" ;; --interval=* ) OPTARG_INTERVAL=true OPTVAL_INTERVAL="${1#--interval=}" ;; --logfacility ) shift OPTARG_LOGFACILITY=true OPTVAL_LOGFACILITY="$1" ;; --logfacility=* ) OPTARG_LOGFACILITY=true OPTVAL_LOGFACILITY="${1#--logfacility=}" ;; -* ) OPTTMP="${1:1}" until [[ -z "$OPTTMP" ]] do case "${OPTTMP:0:1}" in i ) OPTARG_INTERVAL=true OPTVAL_INTERVAL="${OPTTMP:1}" if [[ -z "$OPTVAL_INTERVAL" ]] then shift OPTVAL_INTERVAL="$1" else break fi ;; l ) OPTARG_LOGFACILITY=true OPTVAL_LOGFACILITY="${OPTTMP:1}" if [[ -z "$OPTVAL_LOGFACILITY" ]] then shift OPTVAL_LOGFACILITY="$1" else break fi ;; esac OPTTMP="${OPTTMP:1}" done ;; * ) ARGV=("${ARGV[@]}" "$1") ;; esac shift done } if test -f %{_sysconfdir}/default/smartmontools -a \! -f %{_sysconfdir}/sysconfig/smartmontools ; then . %{_sysconfdir}/default/smartmontools optarg_parse $smartd_opts EXPR= if $OPTARG_INTERVAL ; then echo "SMARTD_CHECK_INTERVAL=\"$OPTVAL_INTERVAL\"" >>%{_sysconfdir}/sysconfig/smartmontools EXPR="s/=\"1800\"/=\"$OPTVAL_INTERVAL\"/;" fi if $OPTARG_LOGFACILITY ; then echo "SMARTD_LOG_FACILITY=\"$OPTVAL_LOGFACILITY\"" >>%{_sysconfdir}/sysconfig/smartmontools EXPR="${EXPR}s/=\"daemon\"/=\"$OPTVAL_LOGFACILITY\"/;" fi sed "$EXPR" </var/adm/fillup-templates/sysconfig.smartmontools >%{_sysconfdir}/sysconfig/smartmontools rm %{_sysconfdir}/default/smartmontools fi #END smartd_opts_migrate %if %suse_version < 1010 # With some broken drivers in older kernels, smartd can hang the system. # Don't start it by default. %{fillup_and_insserv smartd} %else # Turn smartd on by default. %{fillup_and_insserv -Y smartd} %endif # Older SuSE versions (<=10.2) don't do restart on update. Do it now. if test -f var/adm/smartd_needs_restart ; then rm var/adm/smartd_needs_restart %{restart_on_update smartd} fi %preun %{stop_on_removal smartd} %postun %{restart_on_update smartd} %{insserv_cleanup} %files %defattr(-, root, root) %doc %{_docdir}/%{name} %{_datadir}/smartmontools %doc %{_mandir}/man*/* %{_localstatedir}/lib/smartmontools %if %suse_version <= 1100 %{_prefix}/lib/smartmontools %endif %{_sbindir}/* %{_sysconfdir}/init.d/* %config(noreplace) %{_sysconfdir}/smart_drivedb.h %config(noreplace) %{_sysconfdir}/smartd.conf /var/adm/fillup-templates/sysconfig.* %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor