From 357aab1fbbe81fde9eb241b016684c6aeec3142b Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 26 May 2022 16:25:23 -0400 Subject: [PATCH] Auto sync2gitlab import of zstd-1.4.4-1.el8.src.rpm --- .gitignore | 1 + EMPTY | 1 - pzstd.1.patch | 19 +++++ sources | 1 + zstd.spec | 203 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 .gitignore delete mode 100644 EMPTY create mode 100644 pzstd.1.patch create mode 100644 sources create mode 100644 zstd.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da05362 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/zstd-1.4.4.tar.gz diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/pzstd.1.patch b/pzstd.1.patch new file mode 100644 index 0000000..bb03404 --- /dev/null +++ b/pzstd.1.patch @@ -0,0 +1,19 @@ +diff -Naur -Naru zstd-1.3.4/programs/zstd.1 zstd-1.3.4.new/programs/zstd.1 +--- zstd-1.3.4/programs/zstd.1 2018-03-26 22:19:34.000000000 +0000 ++++ zstd-1.3.4.new/programs/zstd.1 2018-03-28 04:28:27.532777239 +0000 +@@ -177,7 +177,14 @@ + . + .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\. +-. ++ ++.SH Parallel Zstd OPTIONS ++Additional options for the pzstd utility ++.TP ++.BR \-p ", " --processes ++ number of threads to use for (de)compression (default:4) ++ ++ + .SH "DICTIONARY BUILDER" + \fBzstd\fR offers \fIdictionary\fR compression, which greatly improves efficiency on small files and messages\. It\'s possible to train \fBzstd\fR with a set of samples, the result of which is saved into a file called a \fBdictionary\fR\. Then during compression and decompression, reference the same dictionary, using command \fB\-D dictionaryFileName\fR\. Compression of small files similar to the sample set will be greatly improved\. + . diff --git a/sources b/sources new file mode 100644 index 0000000..eaa9378 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (zstd-1.4.4.tar.gz) = 8209837e8eb14e474dfe21d5511085f46cef93b03ab77613fd41e7b8be652418231c38852669c8e0b55b78ad41ea2cb8008d0da122a83f8f27e32b5c86f045cf diff --git a/zstd.spec b/zstd.spec new file mode 100644 index 0000000..32c5bd1 --- /dev/null +++ b/zstd.spec @@ -0,0 +1,203 @@ +%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 +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. + + +%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" +done +%if %{with pzstd} +export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11" +%make_build -C contrib/pzstd +%endif + +%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 + +%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 +%{_bindir}/%{name}grep +%{_bindir}/%{name}less +%{_mandir}/man1/%{name}.1* +%{_mandir}/man1/un%{name}.1* +%{_mandir}/man1/%{name}cat.1* +%{_mandir}/man1/%{name}grep.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 + +%ldconfig_scriptlets -n lib%{name} + +%changelog +* Thu Jun 4 2020 Jakub Martisko - 1.4.4-1 +- Rebase to 1.4.4 +Resolvese: 1807452 + +* Tue Oct 15 2019 Jakub Martisko - 1.4.2-2 +- Add some basic gating tests + +* Tue Oct 15 2019 Jakub Martisko - 1.4.2-1 +- Initial rhel commit + +* Wed Jul 31 2019 Pádraig Brady - 1.4.2-1 +- Latest upstream + +* Sat Jul 27 2019 Fedora Release Engineering - 1.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Apr 29 2019 Pádraig Brady - 1.4.0-1 +- Latest upstream + +* Sun Feb 03 2019 Fedora Release Engineering - 1.3.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Dec 31 2018 Pádraig Brady - 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-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jul 02 2018 Pádraig Brady - 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-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Feb 02 2018 Igor Gnatenko - 1.3.3-2 +- Switch to %%ldconfig_scriptlets + +* Thu Dec 21 2017 Pádraig Brady - 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-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sun Jul 16 2017 Pádraig Brady - 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 - 1.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Nov 02 2016 Pádraig Brady - 1.1.1-1 +- Latest upstream + +* Thu Oct 6 2016 Pádraig Brady 1.1.0-2 +- Add pzstd(1) + +* Thu Sep 29 2016 Pádraig Brady 1.1.0-1 +- New upstream release +- Remove examples and static lib + +* Mon Sep 12 2016 Pádraig Brady 1.0.0-2 +- Adjust various upstream links +- Parameterize various items in spec file + +* Mon Sep 5 2016 Pádraig Brady 1.0.0-1 +- Initial release