From f68095d641c9d275e86ae67c2fd34c4db5740ab70263c2e7bd9d556474aaf972 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 15 Jun 2018 07:00:19 +0000 Subject: [PATCH] Accepting request 616852 from home:rudi_m - enable pzstd (parallel zstd) - add pzstd.1.patch, taken from Fedora package (git 21908004) - fix pzstd tests - add pzstd-global-gtest.patch Note, in earlier submit request the pzstd tests were empty. OBS-URL: https://build.opensuse.org/request/show/616852 OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=20 --- pzstd-global-gtest.patch | 33 +++++++++++++++++++++++++++++++++ pzstd.1.patch | 19 +++++++++++++++++++ zstd.changes | 12 ++++++++++++ zstd.spec | 24 +++++++++++++++++++----- 4 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 pzstd-global-gtest.patch create mode 100644 pzstd.1.patch diff --git a/pzstd-global-gtest.patch b/pzstd-global-gtest.patch new file mode 100644 index 0000000..9a2df3d --- /dev/null +++ b/pzstd-global-gtest.patch @@ -0,0 +1,33 @@ +diff -rupN zstd-1.3.4.orig/contrib/pzstd/Makefile zstd-1.3.4/contrib/pzstd/Makefile +--- zstd-1.3.4.orig/contrib/pzstd/Makefile 2018-03-27 00:19:34.000000000 +0200 ++++ zstd-1.3.4/contrib/pzstd/Makefile 2018-06-14 13:46:16.485820353 +0200 +@@ -32,7 +32,7 @@ LDFLAGS ?= + + # Include flags + PZSTD_INC = -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(PROGDIR) -I. +-GTEST_INC = -isystem googletest/googletest/include ++GTEST_INC = + + PZSTD_CPPFLAGS = $(PZSTD_INC) + PZSTD_CCXXFLAGS = +@@ -46,7 +46,7 @@ ALL_LDFLAGS = $(EXTRA_FLAGS) $(LDFLA + + + # gtest libraries need to go before "-lpthread" because they depend on it. +-GTEST_LIB = -L googletest/build/googlemock/gtest ++GTEST_LIB = + LIBS = + + # Compilation commands +@@ -212,10 +212,7 @@ GTEST_CMAKEFLAGS = + .PHONY: googletest + googletest: PZSTD_CCXXFLAGS += -fPIC + googletest: +- @$(RM) -rf googletest +- @git clone https://github.com/google/googletest +- @mkdir -p googletest/build +- @cd googletest/build && cmake $(GTEST_CMAKEFLAGS) -DCMAKE_CXX_FLAGS="$(ALL_CXXFLAGS)" .. && $(MAKE) ++ true + + .PHONY: googletest32 + googletest32: PZSTD_CCXXFLAGS += -m32 diff --git a/pzstd.1.patch b/pzstd.1.patch new file mode 100644 index 0000000..eb2569d --- /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 @@ + .TP + \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) ++ ++ + .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/zstd.changes b/zstd.changes index 877c7e0..c343311 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Jun 14 11:56:45 UTC 2018 - sweet_f_a@gmx.de + +- fix pzstd tests +- add pzstd-global-gtest.patch + +------------------------------------------------------------------- +Thu Jun 14 08:11:32 UTC 2018 - sweet_f_a@gmx.de + +- enable pzstd (parallel zstd) +- add pzstd.1.patch, taken from Fedora package (git 21908004) + ------------------------------------------------------------------- Thu May 24 14:36:12 CEST 2018 - kukuk@suse.de diff --git a/zstd.spec b/zstd.spec index 3bc3d1b..1dae28e 100644 --- a/zstd.spec +++ b/zstd.spec @@ -15,7 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - %define major 1 %define libname lib%{name}%{major} Name: zstd @@ -26,7 +25,12 @@ License: BSD-3-Clause AND GPL-2.0-only Group: Productivity/Archiving/Compression 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 +Patch2: pzstd-global-gtest.patch BuildRequires: gcc +# C++ is needed for pzstd only +BuildRequires: gcc-c++ +BuildRequires: googletest-devel BuildRequires: pkgconfig BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -76,18 +80,26 @@ Needed for compiling programs that link with the library. %prep %setup -q -find -name .gitignore -delete +%patch1 -p1 +%patch2 -p1 %build -for dir in lib programs; do - CFLAGS="%{optflags}" make %{?_smp_mflags} -C "$dir" +export CFLAGS="%{optflags}" +export CXXFLAGS="%{optflags} -std=c++11" +for dir in lib programs contrib/pzstd; do + make %{?_smp_mflags} -C "$dir" done %check -CFLAGS="%{optflags}" make %{?_smp_mflags} -C tests test-zstd +export CFLAGS="%{optflags}" +export CXXFLAGS="%{optflags} -std=c++11" +make %{?_smp_mflags} -C tests test-zstd +make -C contrib/pzstd test-pzstd %install %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} +install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd +install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1 %files %defattr(-,root,root,-) @@ -98,9 +110,11 @@ CFLAGS="%{optflags}" make %{?_smp_mflags} -C tests test-zstd %{_bindir}/zstdless %{_bindir}/zstdmt %{_bindir}/unzstd +%{_bindir}/pzstd %{_mandir}/man1/zstd.1* %{_mandir}/man1/unzstd.1* %{_mandir}/man1/zstdcat.1* +%{_mandir}/man1/pzstd.1* %license COPYING LICENSE %files -n %{libname}