From 1043b88ce9addac62b58cb84c595ed85b9878af8 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Jan 11 2022 01:41:21 +0000 Subject: Rebase to the latest 1.5.1 from Fedora This also adds gz, xz/lzma and lz4 support to the zstd tool Signed-off-by: Michel Alexandre Salim --- diff --git a/.gitignore b/.gitignore index 0ecaf9c..b6b4b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/zstd-1.4.4.tar.gz -SOURCES/zstd-1.5.0.tar.gz +SOURCES/zstd-1.5.1.tar.gz diff --git a/.zstd.metadata b/.zstd.metadata index 7013fff..5cbafc0 100644 --- a/.zstd.metadata +++ b/.zstd.metadata @@ -1 +1 @@ -c53019729e3a595f0104facab6533d78296a2945 SOURCES/zstd-1.5.0.tar.gz +e6a51ef3f7d5be5b74ac74d88bf3850057e00adb SOURCES/zstd-1.5.1.tar.gz diff --git a/SOURCES/pzstd.1.patch b/SOURCES/pzstd.1.patch index f86e8d8..d4e3a1f 100644 --- a/SOURCES/pzstd.1.patch +++ b/SOURCES/pzstd.1.patch @@ -1,9 +1,9 @@ -diff -Naur zstd-1.4.7.orig/programs/zstd.1 zstd-1.4.7/programs/zstd.1 ---- zstd-1.4.7.orig/programs/zstd.1 2020-12-16 23:00:18.000000000 +0000 -+++ zstd-1.4.7/programs/zstd.1 2020-12-17 15:15:22.586152398 +0000 -@@ -208,6 +208,14 @@ - . - .IP "\(bu" 4 +diff -Naur zstd-1.5.1.orig/programs/zstd.1 zstd-1.5.1/programs/zstd.1 +--- zstd-1.5.1.orig/programs/zstd.1 2021-12-20 22:49:18.000000000 +0000 ++++ zstd-1.5.1/programs/zstd.1 2021-12-22 16:49:17.160850340 +0000 +@@ -146,6 +146,14 @@ + \fB\-\-show\-default\-cparams\fR: Shows the default compression parameters that will be used for a particular src file\. If the provided src file is not a regular file (eg\. named pipe), the cli will just output the default parameters\. That is, the parameters that are used when the src size is unknown\. + .IP "\[ci]" 4 \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files + +.SH Parallel Zstd OPTIONS @@ -13,6 +13,6 @@ diff -Naur zstd-1.4.7.orig/programs/zstd.1 zstd-1.4.7/programs/zstd.1 + number of threads to use for (de)compression (default:4) + + - . .IP "" 0 - . + .SS "Restricted usage of Environment Variables" + Using environment variables to set parameters has security implications\. Therefore, this avenue is intentionally restricted\. Only \fBZSTD_CLEVEL\fR and \fBZSTD_NBTHREADS\fR are currently supported\. They set the compression level and number of threads to use during compression, respectively\. diff --git a/SPECS/zstd.spec b/SPECS/zstd.spec index 5b3b7c1..79fa74f 100644 --- a/SPECS/zstd.spec +++ b/SPECS/zstd.spec @@ -1,3 +1,12 @@ +# enable .lz4 support by default +%bcond_without lz4 + +# enable .xz/.lzma support by default +%bcond_without lzma + +# enable .gz support by default +%bcond_without zlib + %if 0%{?rhel} && 0%{?rhel} <= 6 # gcc-4.4 is currently too old to compile pzstd %bcond_with pzstd @@ -11,9 +20,18 @@ %endif %endif +%ifarch x86_64 +%bcond_without asm +%else +# Disable asm to ensure non excutable stack +# used on archs where asm not actually used +# https://github.com/facebook/zstd/issues/2963 +%bcond_with asm +%endif + Name: zstd -Version: 1.5.0 -Release: 2%{?dist} +Version: 1.5.1 +Release: 5%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -22,11 +40,21 @@ Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{n Patch1: pzstd.1.patch -BuildRequires: make +BuildRequires: make BuildRequires: gcc gtest-devel +%if %{with lz4} +BuildRequires: lz4-devel +%endif +%if %{with lzma} +BuildRequires: xz-devel +%endif %if %{with pzstd} BuildRequires: gcc-c++ %endif +%if %{with zlib} +BuildRequires: zlib-devel +%endif +BuildRequires: execstack %description Zstd, short for Zstandard, is a fast lossless compression algorithm, @@ -62,14 +90,18 @@ find -name .gitignore -delete %build export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" -%make_build -C lib lib-mt -%make_build -C programs +export PREFIX="%{_prefix}" +export LIBDIR="%{_libdir}" +%make_build -C lib lib-mt %{!?with_asm:ZSTD_NO_ASM=1} +%make_build -C programs %{!?with_asm:ZSTD_NO_ASM=1} %if %{with pzstd} export CXXFLAGS="$RPM_OPT_FLAGS" -%make_build -C contrib/pzstd +%make_build -C contrib/pzstd %{!?with_asm:ZSTD_NO_ASM=1} %endif %check +execstack lib/libzstd.so.1 + export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" make -C tests test-zstd @@ -121,6 +153,22 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Fri Jan 07 2022 Michel Alexandre Salim - 1.5.1-5 +- Enable gz, .xz/.lzma and .lz4 support + +* Mon Jan 03 2022 Pádraig Brady - 1.5.1-4 +- Use correct prefix for pkgconfig. + +* Wed Dec 29 2021 Pádraig Brady - 1.5.1-3 +- Avoid executable stack on i686 also. + +* Tue Dec 28 2021 Zbigniew Jędrzejewski-Szmek - 1.5.1-2 +- Disable amd64 assembly on non-intel architectures (#2035802): + this should avoid the issue where an executable stack is created. + +* Wed Dec 22 2021 Pádraig Brady - 1.5.1-1 +- Latest upstream + * Fri Jul 23 2021 Fedora Release Engineering - 1.5.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild