File dd_rescue.spec of Package dd_rescue

#
# spec file for package dd_rescue
#
# 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:           dd_rescue
Version:        1.40
Release:        0
Summary:        Data Copying in the Presence of I/O Errors
License:        GPL-2.0 or GPL-3.0
Group:          System/Base
Url:            http://www.garloff.de/kurt/linux/ddrescue/
Source0:        http://garloff.de/kurt/linux/ddrescue/%{name}-%{version}.tar.gz
BuildRequires:  autoconf
BuildRequires:  libattr-devel
BuildRequires:  libfallocate-devel
Requires:       bc
Recommends:     dd_rhelp libfallocate0
# ddrescue was last used in openSUSE 11.4 (version 1.14_0.0.6)
Provides:       ddrescue = %{version}
Obsoletes:      ddrescue < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
dd_rescue helps when nothing else can: your disk has crashed and you
try to copy it over to another one. While standard Unix tools like cp,
cat, and dd will "abort" on every I/O error, dd_rescue does not.

dd_rescue has many other goodies; optimization by using large blocks
as long as no errors are in sight and falling back to small ones; reverse
direction copy; splice in-kernel zerocopy; O_DIRECT support; preallocation
with fallocate(); random number writing etc.

%prep
%setup -q -n dd_rescue

# Remove build time references so build-compare can do its work
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/g" dd_rescue.c
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" dd_rescue.c

%build
make RPM_OPT_FLAGS="%{optflags}" LIBDIR=%{_libdir} %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}/%{_bindir} \
    INSTASROOT= INSTALLFLAGS=

#UsrMerge
mkdir %{buildroot}/bin
ln -sf %{_bindir}/dd_rescue %{buildroot}/bin
#EndUsrMerge

%check
make check

%files
%defattr(-,root,root,-)
%doc COPYING README.dd_rescue
%{_bindir}/dd_rescue
#UsrMerge
/bin/dd_rescue
#EndUsrMerge
%doc %{_mandir}/man1/dd_rescue.1%{ext_man}

%changelog
openSUSE Build Service is sponsored by