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
This commit is contained in:
Martin Pluskal 2018-06-15 07:00:19 +00:00 committed by Git OBS Bridge
parent 2311cbef6f
commit f68095d641
4 changed files with 83 additions and 5 deletions

33
pzstd-global-gtest.patch Normal file
View File

@ -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

19
pzstd.1.patch Normal file
View File

@ -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\.
.

View File

@ -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

View File

@ -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}