Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:42.2:Ports
smartmontools
smartmontools.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File smartmontools.spec of Package smartmontools
# # spec file for package smartmontools # # Copyright (c) 2013 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/ # Name: smartmontools # Important: When doing a version update that changes DRIVEDB_BRANCH # in smartmontools-drivedb_h-update.sh, you have to check, # that the packaged drivedb.h has a higher svn release number than any # version that exist in older svn branches. If not, you have # to implement special case in the %%post section. # Numbers in quotes are release numbers on 2013-12-04. # http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_39_DRIVEDB/smartmontools/drivedb.h#l61 (3412) # http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_40_DRIVEDB/smartmontools/drivedb.h#l78 (3850) # http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_41_DRIVEDB/smartmontools/drivedb.h#l78 (3850) # http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_43_DRIVEDB/smartmontools/drivedb.h#l78 (3850) # http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_6_0_DRIVEDB/smartmontools/drivedb.h#l78 (3850) # http://sourceforge.net/p/smartmontools/code/HEAD/tree/trunk/smartmontools/drivedb.h#l78 (3856) Version: 6.2 Release: 0 Source: http://sourceforge.net/projects/smartmontools/files/smartmontools/%{version}/%{name}-%{version}.tar.gz Source1: %{name}-%{version}.tar.gz.asc Source2: smartmontools.sysconfig Source3: %{name}-rpmlintrc Source4: %{name}.keyring # SOURCE-FEATURE-OPENSUSE smartmontools.generate_smartd_opts.in sbrabec@suse.cz -- sysconfig support for systemd. Source5: %{name}.generate_smartd_opts.in # SOURCE-FEATURE-SLE smartmontools-drivedb_h-update.sh bnc851276 sbrabec@suse.cz -- Supplementary script to update drivedb.h. Source6: smartmontools-drivedb_h-update.sh # SOURCE-FEATURE-UPSTREAM smartmontools-drivedb.h bnc851276 sbrabec@suse.cz -- Update of drivedb.h. Source7: smartmontools-drivedb.h # PATCH-FEATURE-UNITEDLINUX smartmontools-default-enabled.patch sbrabec@suse.cz -- Enable smartd by default. Patch1: smartmontools-default-enabled.patch # PATCH-FEATURE-OPENSUSE smartmontools-removable.patch sbrabec@suse.cz -- Skip removable devices. (bnc#308557) Report raw temperature. Patch4: smartmontools-removable.patch # SUSE-FEATURE-PATCH smartmontools-nobuild-date.patch bnc#647521 pgajdos@suse.cz Patch8: smartmontools-nobuild-date.patch # PATCH-FIX-OPENSUSE smartmontools-var-lock-subsys.patch sbrabec@suse.cz -- Do not use unsupported /var/lock/subsys. Patch10: smartmontools-var-lock-subsys.patch # PATCH-FEATURE-OPENSUSE smartd-service-novm.patch crrodriguez@opensuse.org -- Do not start smartd in virtual environment. Patch11: smartd-service-novm.patch PreReq: %fillup_prereq PreReq: %insserv_prereq # Needed by generate_smartd_opt: PreReq: coreutils %if 0%{?suse_version} <= 1100 Requires: powersave %endif Url: http://smartmontools.sourceforge.net/ BuildRequires: gcc-c++ %if 0%{?suse_version} > 1220 BuildRequires: gpg-offline %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} >= 1110 BuildRequires: libselinux-devel %endif %if 0%{?suse_version} >= 1130 BuildRequires: libcap-ng-devel %endif BuildRequires: pkgconfig(systemd) %{?systemd_requires} Summary: Monitor for SMART devices License: GPL-2.0+ Group: Hardware/Other %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. %prep %if 0%{?gpg_verify:1} %gpg_verify %{S:1} %endif %setup -q cp -a %{SOURCE2} %{SOURCE5} . cp -a %{SOURCE7} drivedb.h %patch1 %patch4 %patch8 -p1 %patch10 -p1 %patch11 # PATCH-FEATURE-OPENSUSE (sed on smartd.service.in) sbrabec@suse.cz -- Use generated smartd_opts (from SUSE sysconfig file). Systemd smartd.service cannot be smart enough to parse SUSE sysconfig file and generate smartd_opts on fly. And we do not want to launch shell just for it in every boot. sed -i "s:/usr/local/etc/sysconfig/smartmontools:%{_localstatedir}/lib/smartmontools/smartd_opts:" smartd.service.in %build %if 0%{?suse_version} > 1000 export CFLAGS="%{optflags} -fPIE" export CXXFLAGS="%{optflags} -fPIE" export LDFLAGS="-pie" %endif %configure\ --with-docdir=%{_defaultdocdir}/%{name}\ %if 0%{?suse_version} >= 1110 --with-selinux\ %endif --with-systemdsystemunitdir=%{_unitdir}\ --enable-drivedb\ --enable-savestates\ --enable-attributelog make %{?_smp_mflags} BUILD_INFO='"(SUSE RPM)"' sed "s:@libdir@:%{_libdir}:g;s:@localstatedir@:%{_localstatedir}:g" <smartmontools.generate_smartd_opts.in >generate_smartd_opts %install %makeinstall %if 0%{?suse_version} <= 1100 || 0%{?suse_version} > 1140 mkdir -p %{buildroot}%{_prefix}/lib/smartmontools %endif %if 0%{?suse_version} <= 1100 cp examplescripts/Example4 %{buildroot}%{_prefix}/lib/smartmontools/smart-notify chmod +x %{buildroot}%{_prefix}/lib/smartmontools/smart-notify %endif mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates cp smartmontools.sysconfig %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.smartmontools mkdir -p %{buildroot}%{_localstatedir}/lib/smartmontools %if 0%{?suse_version} > 1140 touch %{buildroot}%{_localstatedir}/lib/smartmontools/smartd_opts install generate_smartd_opts %{buildroot}%{_prefix}/lib/smartmontools/ %endif cat >%{buildroot}%{_sysconfdir}/smart_drivedb.h <<EOF /* smart_drivedb.h: Custom drive database. See also %{_datadir}/smartmontools/drivedb.h. */ EOF cp smartd.service %{buildroot}/%{_unitdir} # INSTALL file is intended only for packagers. rm %{buildroot}%{_defaultdocdir}/%{name}/INSTALL # Check syntax of drivedb.h that may come from a later snapshot (code from update-smart-drivedb) if ./smartctl -B drivedb.h -P showall >/dev/null; then :; else echo "drivedb.h.error: rejected by smartctl, probably no longer compatible" >&2 exit 1 fi # Intelligent drivedb.h update, part 0. # Check that drivedb.h has well formed svn RELEASE. We will need it for the intelligent update. DRIVEDB_H_RELEASE_CHECK="$(sed -n 's/^.*$Id: drivedb.h \([0-9][0-9]*\) .*$/\1/p' <%{buildroot}%{_datadir}/smartmontools/drivedb.h)" # Fail if the file has broken release number. test "$DRIVEDB_H_RELEASE_CHECK" -ge 0 %clean rm -rf %{buildroot} %pre %service_add_pre smartd.service # Intelligent drivedb.h update, part 1. # Save installed drivedb.h. Maybe the sysadmin called update-smart-drivedb, # and the installed drivedb.h may be even newer than the new packaged one. if test -f %{_datadir}/smartmontools/drivedb.h ; then # Be on safe side, remove any potential drivedb.h.rpmsave. rm -f %{_datadir}/smartmontools/drivedb.h.rpmsave ln %{_datadir}/smartmontools/drivedb.h %{_datadir}/smartmontools/drivedb.h.rpmsave fi %post # First prepare sysconfig. %{fillup_only} %if 0%{?suse_version} > 1140 # Then generate initial %{_localstatedir}/lib/smartmontools/smartd_opts needed by smartd.service. SMARTD_SKIP_INIT=1 %{_prefix}/lib/smartmontools/generate_smartd_opts %endif # No start by default here.. belongs to -presets packages %service_add_post smartd.service # Intelligent drivedb.h update, part 2. # Now we have the old system drivedb.h and the new packaged drivedb.h. if test -f %{_datadir}/smartmontools/drivedb.h.rpmsave ; then # Compare their release numbers. DRIVEDB_H_RELEASE_RPM="$(sed -n 's/^.*$Id: drivedb.h \([0-9][0-9]*\) .*$/\1/p' <%{_datadir}/smartmontools/drivedb.h)" DRIVEDB_H_RELEASE_SAVED="$(sed -n 's/^.*$Id: drivedb.h \([0-9][0-9]*\) .*$/\1/p' <%{_datadir}/smartmontools/drivedb.h.rpmsave)" # File has broken release number. Skip the update. # Note: The SAVED release number may be broken. The test syntax must cover it. if test "$DRIVEDB_H_RELEASE_RPM" -lt "$DRIVEDB_H_RELEASE_SAVED" ; then mv %{_datadir}/smartmontools/drivedb.h.rpmsave %{_datadir}/smartmontools/drivedb.h else # Saved file is older or equal, or saved file has broken release number. rm %{_datadir}/smartmontools/drivedb.h.rpmsave # We returned to the vanilla packages, remove files created by update-smart-drivedb. rm -f %{_datadir}/smartmontools/drivedb.h.old %{_datadir}/smartmontools/drivedb.h.lastcheck fi fi %preun %service_del_preun smartd.service %postun %service_del_postun smartd.service %files %defattr(-, root, root) %doc %{_docdir}/%{name} %dir %{_datadir}/smartmontools %verify(not md5 size mtime) %{_datadir}/smartmontools/drivedb.h %doc %{_mandir}/man*/* %dir %{_localstatedir}/lib/smartmontools %if 0%{?suse_version} > 1140 %ghost %{_localstatedir}/lib/smartmontools/smartd_opts %endif %if 0%{?suse_version} <= 1100 || 0%{?suse_version} > 1140 %{_prefix}/lib/smartmontools %endif %{_unitdir}/* %{_sbindir}/* %config(noreplace) %{_sysconfdir}/smart_drivedb.h %config(noreplace) %{_sysconfdir}/smartd.conf %config(noreplace) %{_sysconfdir}/smartd_warning.sh %{_localstatedir}/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