build shared library with correct compiler flags

* lib-make.patch: Fix regression in 1.4.5 lib/Makefile
* zstd.spec: Apply the patch
This commit is contained in:
Pádraig Brady 2020-05-25 13:22:39 +01:00
parent e90e28190f
commit a2c88d401a
2 changed files with 44 additions and 1 deletions

38
lib-make.patch Normal file
View File

@ -0,0 +1,38 @@
From 66db79bbb0977bea7023000dca6211c2cacf9a07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Mon, 25 May 2020 13:16:31 +0100
Subject: [PATCH] fix generalization of pattern rules in lib/Makefile
This was introduced in v1.4.4-383-gf77fd5ce
and results in the default rule in lib/ doing nothing.
---
lib/Makefile | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/Makefile b/lib/Makefile
index e6213ac8..de437a98 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -221,14 +221,14 @@ libzstd : $(LIBZSTD)
lib : libzstd.a libzstd
.PHONY: lib-mt
-%-mt : CPPFLAGS += -DZSTD_MULTITHREAD
-%-mt : LDFLAGS += -pthread
-%-mt : %
+% : CPPFLAGS += -DZSTD_MULTITHREAD
+% : LDFLAGS += -pthread
+% : lib
@echo multi-threading build completed
.PHONY: lib-release
-%-release : DEBUGFLAGS :=
-%-release : %
+% : DEBUGFLAGS :=
+% : lib
@echo release build completed
--
2.26.2

View File

@ -13,7 +13,7 @@
Name: zstd
Version: 1.4.5
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Zstd compression library
License: BSD and GPLv2
@ -21,6 +21,7 @@ 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: lib-make.patch
BuildRequires: gcc gtest-devel
%if %{with pzstd}
@ -57,6 +58,7 @@ find -name .gitignore -delete
%if %{with pzstd}
%patch1 -p1
%endif
%patch2 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS"
@ -122,6 +124,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
%ldconfig_scriptlets -n lib%{name}
%changelog
* Fri May 25 2020 Pádraig Brady <P@draigBrady.com> - 1.4.5-2
- Build shared library with correct compiler flags
* Fri May 22 2020 Pádraig Brady <P@draigBrady.com> - 1.4.5-1
- Latest upstream