dd_rescue/dd_rescue.spec
Kurt Garloff 6a54235536 - Update to dd_rescue-1.99.20:
* Fix an overrun in sparse block detection.
  * Fix an off-by-one memory handling issue in ddr_lzo, resulting
    in breakage on s390x. (Surprisingly, glibc memory allocator
    was graceful on most architectures.)
  * Better test coverage, including chains with sparse files.
  * Documented (and somewhat cleaner) design of handling sparse
    files through chains of plugins.
  * Test and support compression+encryption (and reverse
    decryption+decompression) chains.
  * Improved debug output, including numbering plugins.
- Update to dd_rescue-1.99.19:
  * ddr_crypt: Clean hole support with and without skiphole.
    (This works cleanly only for CTR and ECB modes.)
  * ddr_crypt: Fix backwards copies including holes. Note that
    this could result in different files from the forward copies
    before (bug). Add test case for the latter.
  * Many more testcases for sparse files with plugins: Also use
    odd sizes and holes at the beginning and end of the file.
  * Also skip over holes with -a when copying in reverse dir.
  * Allow setting unsparse and some other flags for ddr_null for
    testing.
  * Fix lzma compression with hole at the end.
  * Warn on lzma buf error (was debug msg only before).

OBS-URL: https://build.opensuse.org/package/show/Base:System/dd_rescue?expand=0&rev=89
2025-01-26 08:05:31 +00:00

191 lines
6.3 KiB
RPMSpec

#
# spec file for package dd_rescue
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%ifarch aarch64 %{arm}
# boo#1176219
%define _lto_cflags %{nil}
%endif
Name: dd_rescue
Version: 1.99.20
Release: 0
Summary: Data copying in the presence of I/O Errors
License: GPL-2.0-only OR GPL-3.0-only
Group: System/Base
URL: http://www.garloff.de/kurt/linux/ddrescue/
Source0: http://garloff.de/kurt/linux/ddrescue/%{name}-%{version}.tar.bz2
Source1: http://garloff.de/kurt/linux/ddrescue/%{name}-%{version}.tar.bz2.asc
Source2: %{name}.keyring
Source99: %{name}.changes
# PATCH-FIX-UPSTREAM no-python2.patch sf#ddrescue#4 mcepl@suse.com
# Remove dependency on python2
BuildRequires: autoconf
BuildRequires: libattr-devel
# Workaround for bsc#1193438
BuildRequires: libopenssl-devel
BuildRequires: lzo-devel
BuildRequires: lzop
BuildRequires: pkgconfig
BuildRequires: python3-base
BuildRequires: xz-devel
Requires: bc
Recommends: dd_rescue-crypt
Recommends: dd_rescue-lzo
Recommends: dd_rhelp
# ddrescue was last used in openSUSE 11.4 (version 1.14_0.0.6)
Provides: ddrescue = %{version}
Obsoletes: ddrescue < %{version}
%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 a hash, an lzo and a crypt plugin
exist, supporting on the fly hash/HMAC calculation/validation, lzo
de/compression and de/encryption. The lzo plugin is packaged in the
dd_rescue-lzo, the crypt plugin in the dd_rescue-crypt subpackage.
%package crypt
Summary: Crypt plugin for dd_rescue
Group: System/Base
Requires: dd_rescue = %{version}
%description crypt
This plugin allows you do de/encrypt files during recovery copying
with dd_rescue using the AES family of algorithms. The plugin
supports various numbers of bits and rounds and uses the x86 AESNI
CPU support if available.
The plugin does offer a variety of options to handle the keys
and IVs including the generating keys from password and salt.
The plugin is new as of 1.98 and it despite diligent testing it
might be careful to expect some bugs and future changes.
%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.
%package lzma
Summary: LZMA (xz) de/compression plugin for dd_rescue
Group: System/Base
Requires: dd_rescue = %{version}
%description lzma
This plugin allows you do de/compress files during recovery copying
with dd_rescue using the lzma compression algorithm. The lzma algorithm
is fairly slow when compressing, but achieves a good compression ratio.
Decompression is much faster.
This plugin is still new and may not be very mature yet. It may be
a bad idea to feed it with untrusted data, especially when running
with elevated privileges.
Authors:
--------
Dmitrii Ivanov <dsivanov_9@edu.hse.ru>
Kurt Garloff <kurt@garloff.de>
%prep
%autosetup -p1
# Remove build time references so build-compare can do its work
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{SOURCE99} '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{SOURCE99} '+%%b %%e %%Y')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/g" dd_rescue.c
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" dd_rescue.c
%build
autoheader
autoconf
%configure
# avoid running dependency generation step
touch .dep
%make_build RPM_OPT_FLAGS="%{optflags}" LIBDIR=%{_libdir} LIB=%{_lib}
%install
%make_install RPM_OPT_FLAGS="%{optflags}" INSTALLDIR=%{buildroot}/%{_bindir} LIB=%{_lib} LIBDIR=%{_libdir} \
INSTASROOT= INSTALLFLAGS=
%if 0%{?suse_version} < 1550
mkdir %{buildroot}/bin
ln -sf %{_bindir}/dd_rescue %{buildroot}/bin
%endif
%check
%make_build RPM_OPT_FLAGS="%{optflags} -fcommon -fno-strict-aliasing" check
%files
%doc README.dd_rescue TODO
%license COPYING
%{_bindir}/dd_rescue
%if 0%{?suse_version} < 1550
/bin/dd_rescue
%endif
%{_libdir}/libddr_hash.so
%{_libdir}/libddr_MD5.so
%{_libdir}/libddr_null.so
%{_mandir}/man1/dd_rescue.1%{?ext_man}
%files crypt
%{_mandir}/man1/ddr_crypt.1%{?ext_man}
%{_libdir}/libddr_crypt.so
%doc CRYPT_TODO PADDING
%files lzo
%{_libdir}/libddr_lzo.so
%{_mandir}/man1/ddr_lzo.1%{?ext_man}
%files lzma
%{_libdir}/libddr_lzma.so
%{_mandir}/man1/ddr_lzma.1%{?ext_man}
%changelog