Accepting request 950053 from home:dirkmueller:Factory

- enable zlib/gzip compatible backend, as zlib is significantly
  (50%-100%) faster than gzip
- add zstd-gzip compatibility subpackage which can be used
  as a drop in compatible replacement for gzip
- small spec file cleanups

OBS-URL: https://build.opensuse.org/request/show/950053
OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=75
This commit is contained in:
Bernhard M. Wiedemann 2022-01-31 09:43:08 +00:00 committed by Git OBS Bridge
parent ced1fa5cd0
commit 138094e8b8
2 changed files with 47 additions and 11 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sun Jan 30 22:59:24 UTC 2022 - Dirk Müller <dmueller@suse.com>
- enable zlib/gzip compatible backend, as zlib is significantly
(50%-100%) faster than gzip
- add zstd-gzip compatibility subpackage which can be used
as a drop in compatible replacement for gzip
- small spec file cleanups
-------------------------------------------------------------------
Fri Jan 21 04:53:08 UTC 2022 - Bernhard Wiedemann <bwiedemann@suse.com>

View File

@ -16,10 +16,9 @@
#
%define major 1
%define libname lib%{name}%{major}
%define libname libzstd1
Name: zstd
Version: %{major}.5.2
Version: 1.5.2
Release: 0
Summary: Zstandard compression tools
License: BSD-3-Clause AND GPL-2.0-only
@ -34,6 +33,8 @@ BuildRequires: gcc
# C++ is needed for pzstd only
BuildRequires: gcc-c++
BuildRequires: pkgconfig
# for .gz support
BuildRequires: pkgconfig(zlib)
%description
Zstd, short for Zstandard, is a lossless compression algorithm. Speed
@ -84,15 +85,30 @@ targeting faster compression than zlib at comparable ratios.
Needed for compiling programs that link with the library.
%package gzip
Summary: zstd and zlib based gzip drop-in
Group: Productivity/Archiving/Compression
Conflicts: alternative(gzip)
Provides: gzip
Provides: alternative(gzip)
Requires: %{name} >= %{version}
%description gzip
Zstd, short for Zstandard, is a lossless compression algorithm,
targeting faster compression than zlib at comparable ratios.
This subpackage provides a compatible alternative to gzip(1) using
an optimized deflate/zlib handling.
%prep
%autosetup -p1
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CFLAGS="%{optflags}"
export CXXFLAGS="$CFLAGS -std=c++11"
export CXXFLAGS="%{optflags} -std=c++11"
# lib-mt is alias for multi-threaded library support
%make_build prefix=%{_prefix} libdir=%{_libdir} -C lib lib-mt
%make_build HAVE_ZLIB=1 prefix=%{_prefix} libdir=%{_libdir} -C lib lib-mt
for dir in programs contrib/pzstd; do
%make_build -C "$dir"
done
@ -101,22 +117,33 @@ done
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags} -std=c++11"
%make_build -C tests test-zstd
#make %{?_smp_mflags} -C contrib/pzstd test-pzstd
#make_build -C contrib/pzstd test-pzstd
%install
%make_install V=1 VERBOSE=1 prefix=%{_prefix} libdir=%{_libdir}
install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd
install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1
ln -s zstd %{buildroot}/%{_bindir}/gzip
ln -s zstd %{buildroot}/%{_bindir}/gunzip
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%license COPYING LICENSE
%doc README.md CHANGELOG
%{_bindir}/*
%{_bindir}/pzstd
%{_bindir}/unzstd
%{_bindir}/zstd
%{_bindir}/zstdcat
%{_bindir}/zstdgrep
%{_bindir}/zstdless
%{_bindir}/zstdmt
%{_mandir}/man1/*.1%{?ext_man}
%files -n %{libname}
%license COPYING LICENSE
%{_libdir}/libzstd.so.*
%{_libdir}/libzstd.so.1*
%files -n lib%{name}-devel
%license COPYING LICENSE
@ -125,10 +152,10 @@ install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1
%{_libdir}/libzstd.so
%files -n lib%{name}-devel-static
%license COPYING LICENSE
%{_libdir}/libzstd.a
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files gzip
%{_bindir}/gzip
%{_bindir}/gunzip
%changelog