Update to 1.43, with a number of improvements (e.g. ARMv8 optimized zero-block detection) and most importantly the dd_rescue-lzo subpackage that provides a dd_rescue plugin with lzo de/compression support. OBS-URL: https://build.opensuse.org/request/show/234945 OBS-URL: https://build.opensuse.org/package/show/Base:System/dd_rescue?expand=0&rev=22
126 lines
4.4 KiB
RPMSpec
126 lines
4.4 KiB
RPMSpec
#
|
|
# spec file for package dd_rescue
|
|
#
|
|
# Copyright (c) 2014 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.43
|
|
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
|
|
Patch0: http://garloff.de/kurt/linux/ddrescue/%{name}-%{version}-%{version}.1.diff
|
|
BuildRequires: autoconf
|
|
BuildRequires: libattr-devel
|
|
BuildRequires: lzo-devel
|
|
%if 0%{?suse_version} >= 1200
|
|
BuildRequires: libfallocate-devel
|
|
BuildRequires: lzop
|
|
%endif
|
|
Requires: bc
|
|
Recommends: dd_rhelp libfallocate0 dd_rescue-lzo
|
|
# 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().
|
|
|
|
dd_rescue also provides data protection features by overwriting files
|
|
or disks with fast random numbers, optionally multiple times.
|
|
|
|
dd_rescue supports plugins; currently an MD5 and an lzo plugin exist.
|
|
|
|
%package lzo
|
|
Summary: LZO plugin for dd_rescue
|
|
Group: System/Base
|
|
Requires: dd_rescue = %{version}
|
|
|
|
%description lzo
|
|
This plugin allows you do de/compress files during recovery copying
|
|
with dd_rescue using the lzo family of algorithms. lzo algorithms
|
|
are very fast to decompress and most algorithms are very fast to
|
|
compress as well -- at the expense of somewhat worse compression than
|
|
zlib's deflate.
|
|
|
|
The plugin does offer a variety of options to handle corrupted .lzo
|
|
files with some grace; it does skip over bad blocks (if the block
|
|
headers are still intact) by default, but does offer an option (nodiscard)
|
|
to allow to attempt decompression on faulty input, hoping to produce
|
|
some usable bytes. It can also search for valid block headers after
|
|
synchronization has been lost due to a corrupt one.
|
|
|
|
The plugin also handles sparse files (files with holes) and supports
|
|
appending to .lzo files, so it fits neatly into dd_rescue.
|
|
|
|
Some fuzz testing has been applied to the plugin's decompression routines,
|
|
though more will have to be done to feel confident about feeding untrusted
|
|
data to the decompressor; the plugin is still young and might expose bugs.
|
|
|
|
%prep
|
|
%setup -q -n dd_rescue
|
|
%patch0 -p0
|
|
./autogen.sh
|
|
|
|
# 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
|
|
flags="%{optflags}"
|
|
make RPM_OPT_FLAGS="$flags" LIBDIR=%{_libdir} LIB=%{_lib} %{?_smp_mflags}
|
|
|
|
%install
|
|
make install DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}/%{_bindir} LIB=%{_lib} LIBDIR=%{_libdir} \
|
|
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
|
|
%{_libdir}/libddr_MD5.so
|
|
%doc %{_mandir}/man1/dd_rescue.1%{ext_man}
|
|
|
|
%files lzo
|
|
%defattr(-,root,root,-)
|
|
%{_libdir}/libddr_lzo.so
|
|
%doc %{_mandir}/man1/ddr_lzo.1%{ext_man}
|
|
|
|
%changelog
|