diff --git a/SOURCES/pzstd.1.patch b/SOURCES/pzstd.1.patch index c0c451a..d4e3a1f 100644 --- a/SOURCES/pzstd.1.patch +++ b/SOURCES/pzstd.1.patch @@ -1,10 +1,10 @@ -diff -Naur zstd-1.4.4.orig/programs/zstd.1 zstd-1.4.4/programs/zstd.1 ---- zstd-1.4.4.orig/programs/zstd.1 2019-11-04 17:54:32.000000000 +0000 -+++ zstd-1.4.4/programs/zstd.1 2020-01-15 14:25:34.227060058 +0000 -@@ -209,6 +209,14 @@ - .TP - \fB\-\-\fR - All arguments after \fB\-\-\fR are treated as files +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 +Additional options for the pzstd utility @@ -13,6 +13,6 @@ diff -Naur zstd-1.4.4.orig/programs/zstd.1 zstd-1.4.4/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 is supported currently, for setting compression level\. \fBZSTD_CLEVEL\fR can be used to set the level between 1 and 19 (the "normal" range)\. If the value of \fBZSTD_CLEVEL\fR is not a valid integer, it will be ignored with a warning message\. \fBZSTD_CLEVEL\fR just replaces the default compression level (\fB3\fR)\. It can be overridden by corresponding command line arguments\. + 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 2df5e17..29e59fc 100644 --- a/SPECS/zstd.spec +++ b/SPECS/zstd.spec @@ -1,93 +1,79 @@ -%if 0%{?rhel} && 0%{?rhel} <= 6 -# gcc-4.4 is currently too old to compile pzstd -%bcond_with pzstd -%else -%ifarch %{ix86} x86_64 -%bcond_without pzstd -%else -# aarch64 and armv7hl at least currently segfault -# in ThreadPool test for the pzstd util -%bcond_with pzstd -%endif -%endif - Name: zstd -Version: 1.4.4 +Version: 1.5.1 Release: 1%{?dist} Summary: Zstd compression library - License: BSD and GPLv2 URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz - Patch1: pzstd.1.patch - BuildRequires: gcc gtest-devel -%if %{with pzstd} BuildRequires: gcc-c++ -%endif + %description Zstd, short for Zstandard, is a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level compression ratio. + %package -n lib%{name} Summary: Zstd shared library - %description -n lib%{name} Zstandard compression shared library. + %package -n lib%{name}-devel Summary: Header files for Zstd library Requires: lib%{name}%{?_isa} = %{version}-%{release} - %description -n lib%{name}-devel Header files for Zstd library. +%package -n lib%{name}-static +Summary: Static variant of the Zstd library +Requires: lib%{name}-devel = %{version}-%{release} +%description -n lib%{name}-static +Static variant of the Zstd library. + + %prep %setup -q find -name .gitignore -delete -%if %{with pzstd} %patch1 -p1 -%endif + %build export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" for dir in lib programs; do - %make_build -C "$dir" + %make_build -C "$dir" %{!?with_asm:ZSTD_NO_ASM=1} done -%if %{with pzstd} export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11" -%make_build -C contrib/pzstd -%endif +%make_build -C contrib/pzstd %{!?with_asm:ZSTD_NO_ASM=1} + %check export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" make -C tests test-zstd -%if %{with pzstd} export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11" make -C contrib/pzstd test -%endif + %install %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} -# Don't install the static lib -rm %{buildroot}%{_libdir}/libzstd.a -%if %{with pzstd} install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 -%endif + + +%pre -n lib%{name} -p /sbin/ldconfig +%post -n lib%{name} -p /sbin/ldconfig + %files %doc CHANGELOG README.md %{_bindir}/%{name} -%if %{with pzstd} %{_bindir}/p%{name} %{_mandir}/man1/p%{name}.1* -%endif %{_bindir}/%{name}mt %{_bindir}/un%{name} %{_bindir}/%{name}cat @@ -100,99 +86,22 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %{_mandir}/man1/%{name}less.1* %license COPYING LICENSE + %files -n lib%{name} %{_libdir}/libzstd.so.* %license COPYING LICENSE + %files -n lib%{name}-devel -%{_includedir}/zbuff.h %{_includedir}/zdict.h %{_includedir}/zstd.h %{_includedir}/zstd_errors.h %{_libdir}/pkgconfig/libzstd.pc %{_libdir}/libzstd.so -%post -n lib%{name} -p /sbin/ldconfig -%postun -n lib%{name} -p /sbin/ldconfig - - -%changelog -* Wed Jan 15 2020 Pádraig Brady
- 1.4.4-1 -- Latest upstream -* Wed Jul 31 2019 Pádraig Brady
- 1.4.2-1
-- Latest upstream
+%files -n lib%{name}-static
+%{_libdir}/libzstd.a
-* Sat Jul 27 2019 Fedora Release Engineering - 1.4.0-1
-- Latest upstream
-
-* Sun Feb 03 2019 Fedora Release Engineering - 1.3.8-1
-- Latest upstream
-
-* Mon Oct 08 2018 Pádraig Brady - 1.3.6-1
-- Latest upstream
-
-* Sat Jul 14 2018 Fedora Release Engineering - 1.3.5.1
-- Latest upstream
-
-* Wed Mar 28 2018 Pádraig Brady - 1.3.4-1
-- Latest upstream
-
-* Fri Feb 09 2018 Fedora Release Engineering - 1.3.3-1
-- Latest upstream
-
-* Fri Nov 10 2017 Pádraig Brady - 1.3.2-1
-- Latest upstream
-
-* Mon Aug 21 2017 Pádraig Brady - 1.3.1-1
-- Latest upstream
-
-* Thu Aug 03 2017 Fedora Release Engineering - 1.3.0-1
-- Latest upstream
-
-* Mon May 08 2017 Pádraig Brady - 1.2.0-1
-- Latest upstream
-
-* Mon Mar 06 2017 Pádraig Brady - 1.1.3-1
-- Latest upstream
-
-* Sat Feb 11 2017 Fedora Release Engineering