diff --git a/zstd/zstd.patch b/zstd/zstd.patch index f63ef9d183..9ae6fc6b44 100644 --- a/zstd/zstd.patch +++ b/zstd/zstd.patch @@ -1,6 +1,6 @@ Index: Makefile ---- Makefile.orig 2017-10-08 11:41:28.000000000 +0200 -+++ Makefile 2017-10-18 07:33:26.050934000 +0200 +--- Makefile.orig 2017-12-21 10:16:40.000000000 +0100 ++++ Makefile 2018-01-28 10:08:09.507181000 +0100 @@ -36,9 +36,9 @@ #skip zwrapper, can't build that on alternate architectures without the proper zlib installed .PHONY: allzstd @@ -14,7 +14,7 @@ Index: Makefile .PHONY: all32 all32: -@@ -115,8 +115,8 @@ +@@ -118,8 +118,8 @@ .PHONY: install clangtest armtest usan asan uasan install: @@ -26,9 +26,9 @@ Index: Makefile .PHONY: uninstall uninstall: Index: lib/Makefile ---- lib/Makefile.orig 2017-10-08 11:41:28.000000000 +0200 -+++ lib/Makefile 2017-10-18 07:34:11.626438000 +0200 -@@ -62,9 +62,9 @@ +--- lib/Makefile.orig 2017-12-21 10:16:40.000000000 +0100 ++++ lib/Makefile 2018-01-28 10:10:17.006952000 +0100 +@@ -62,14 +62,14 @@ .PHONY: default all clean install uninstall @@ -40,7 +40,25 @@ Index: lib/Makefile libzstd.a: ARFLAGS = rcs libzstd.a: $(ZSTD_OBJ) -@@ -159,14 +159,11 @@ + @echo compiling static library +- @$(AR) $(ARFLAGS) $@ $^ ++ $(AR) $(ARFLAGS) $@ $^ + + libzstd.a-mt: CPPFLAGS += -DZSTD_MULTITHREAD + libzstd.a-mt: libzstd.a +@@ -134,11 +134,7 @@ + includedir ?= $(PREFIX)/include + INCLUDEDIR ?= $(includedir) + +-ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly)) +-PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig +-else + PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig +-endif + + ifneq (,$(filter $(shell uname),SunOS)) + INSTALL ?= ginstall +@@ -159,14 +155,11 @@ -e 's|@VERSION@|$(VERSION)|' \ $< >$@ @@ -57,8 +75,8 @@ Index: lib/Makefile @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR) @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR) Index: programs/Makefile ---- programs/Makefile.orig 2017-10-18 07:32:37.288532000 +0200 -+++ programs/Makefile 2017-10-18 07:34:32.903715000 +0200 +--- programs/Makefile.orig 2017-12-21 10:16:40.000000000 +0100 ++++ programs/Makefile 2018-01-28 10:08:09.507492000 +0100 @@ -259,7 +259,7 @@ bindir ?= $(exec_prefix)/bin BINDIR ?= $(bindir) diff --git a/zstd/zstd.spec b/zstd/zstd.spec index 3d01229996..153e1bd29f 100644 --- a/zstd/zstd.spec +++ b/zstd/zstd.spec @@ -32,11 +32,28 @@ Class: EVAL Group: Compression License: BSD Version: 1.3.3 -Release: 20171221 +Release: 20180128 + +# package options +%option with_zlib no +%option with_xz no +%option with_lz4 no # list of sources Source0: https://github.com/facebook/zstd/archive/v%{version}.zip Patch0: zstd.patch +%if "%{with_zlib}" == "yes" +BuildPreReq: zlib +PreReq: zlib +%endif +%if "%{with_xz}" == "yes" +BuildPreReq: xz +PreReq: xz +%endif +%if "%{with_lz4}" == "yes" +BuildPreReq: lz4 +PreReq: lz4 +%endif # build information BuildPreReq: OpenPKG, openpkg >= 20160101 @@ -60,16 +77,15 @@ PreReq: OpenPKG, openpkg >= 20160101 %patch -p0 %build - %{l_make} %{l_mflags -O} \ - CC="%{l_cc} %{l_cflags -O}" + %{l_make} %{l_mflags} \ + CC="%{l_cc}" \ + CFLAGS="%{l_cflags} -O3 %{l_cppflags} %{l_ldflags}" %install %{l_make} %{l_mflags} -C lib install \ - CC="%{l_cc} %{l_cflags -O}" \ DESTDIR=$RPM_BUILD_ROOT \ PREFIX=%{l_prefix} %{l_make} %{l_mflags} -C programs install \ - CC="%{l_cc} %{l_cflags -O}" \ DESTDIR=$RPM_BUILD_ROOT \ PREFIX=%{l_prefix} strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true