diff --git a/pzstd.1.patch b/pzstd.1.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6016c7de63327b410451828200ab0a0802ee053 --- /dev/null +++ b/pzstd.1.patch @@ -0,0 +1,17 @@ +diff -Naur zstd-1.5.4/programs/zstd.1 zstd-1.5.4.new/programs/zstd.1 +--- zstd-1.5.4/programs/zstd.1 2023-02-10 00:41:50.000000000 +0000 ++++ zstd-1.5.4.new/programs/zstd.1 2023-02-13 12:44:01.575160149 +0000 +@@ -162,6 +162,13 @@ + \fB\-\-show\-default\-cparams\fR: shows the default compression parameters that will be used for a particular input file, based on the provided compression level and the input size\. If the provided file is not a regular file (e\.g\. a pipe), this flag will output the parameters used for inputs of unknown size\. + .IP "\[ci]" 4 + \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files ++ ++.SH Parallel Zstd OPTIONS ++Additional options for the pzstd utility ++.TP ++.BR \-p ", " --processes ++ number of threads to use for (de)compression (default:4) ++ + .IP "" 0 + .SS "gzip Operation Modifiers" + When invoked via a \fBgzip\fR symlink, \fBzstd\fR will support further options that intend to mimic the \fBgzip\fR behavior: diff --git a/zstd-1.5.5.tar.zst b/zstd-1.5.5.tar.zst new file mode 100644 index 0000000000000000000000000000000000000000..8b97b204e1d0bc47986f759caaa5de7c43d7182b Binary files /dev/null and b/zstd-1.5.5.tar.zst differ diff --git a/zstd.spec b/zstd.spec new file mode 100644 index 0000000000000000000000000000000000000000..aa7b04523d1760431f5bb61cefe5e7f41a0672ea --- /dev/null +++ b/zstd.spec @@ -0,0 +1,179 @@ +%define anolis_release 1 + +%bcond_without asm +%bcond_without lz4 +%bcond_without lzma +%bcond_without zlib +%bcond_without pzstd + +Name: zstd +Version: 1.5.5 +Release: %{anolis_release}%{?dist} +Summary: Zstd compression library + +License: BSD-3-Clause +URL: https://github.com/facebook/zstd +Source0: https://github.com/facebook/zstd/releases/download/v%{version}/%{name}-%{version}.tar.zst + +Patch1: pzstd.1.patch + +BuildRequires: make cmake +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 +Requires: lib%{name} = %{version}-%{release} + +%description +Zstd, short for Zstandard, is a fast lossless compression algorithm, +targeting real-time compression scenarios at zlib-level compression ratio. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%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} = %{version}-%{release} + +%package -n lib%{name}-static +Summary: Static variant of the Zstd library +Requires: lib%{name}-devel = %{version}-%{release} + +%description -n lib%{name}-devel +Header files for Zstd library. + +%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" +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 %{!?with_asm:ZSTD_NO_ASM=1} +%endif + +pushd build/cmake +mkdir builddir +cd builddir +cmake .. +%make_build +popd + +%install +%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} +%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 + +pushd build/cmake/builddir +mkdir cmake_install_dir +make install DESTDIR=./cmake_install_dir +mkdir -p %{buildroot}/%{_libdir}/cmake/zstd +cp -r cmake_install_dir/usr/local/lib64/cmake/zstd/*.cmake %{buildroot}/%{_libdir}/cmake/zstd/ +popd + +%generate_compatibility_deps + +%check +execstack lib/libzstd.so.1 + +export CFLAGS="$RPM_OPT_FLAGS" +export LDFLAGS="$RPM_LD_FLAGS" +%make_build -C tests test-zstd +%if %{with pzstd} +export CXXFLAGS="$RPM_OPT_FLAGS" +%make_build -C contrib/pzstd test +%endif + +%files +%license COPYING LICENSE +%{_bindir}/%{name} +%if %{with pzstd} +%{_bindir}/p%{name} +%{_mandir}/man1/p%{name}.1* +%{abidir}/p%{name}-option.list +%endif +%{abidir}/%{name}*-option.list +%{_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* + +%files doc +%doc CHANGELOG README.md + +%files -n lib%{name} +%license COPYING LICENSE +%dir %{abidir} +%{_libdir}/libzstd.so.* +%{abidir}/libzstd.dump + +%files -n lib%{name}-devel +%{_includedir}/zdict.h +%{_includedir}/zstd.h +%{_includedir}/zstd_errors.h +%{_libdir}/pkgconfig/libzstd.pc +%{_libdir}/libzstd.so +%{_libdir}/cmake/zstd/ + +%files -n lib%{name}-static +%{_libdir}/libzstd.a + +%changelog +* Mon Apr 17 2023 Funda Wang - 1.5.5-1 +- New version 1.5.5 + +* Sat Feb 25 2023 Funda Wang - 1.5.4-1 +- New version 1.5.4 + +* Sun Jan 08 2023 Shawn Wang - 1.5.2-4 +- add some patches from upstream + +* Fri Nov 11 2022 happy_orange - 1.5.2-3 +- add cmake files in devel package + +* Wed Oct 19 2022 mgb01105731 - 1.5.2-2 +- optimise spec file & add doc package + +* Wed Mar 09 2022 zhang xianting - 1.5.2-1 +- Initial build for Anolis V23