[packages/libargon2] move sed patching to .patch file
glen
glen at pld-linux.org
Wed Aug 23 08:12:09 CEST 2017
commit 6c325e887cc835fa378cfd88d765fc2174de3783
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Wed Aug 23 09:06:49 2017 +0300
move sed patching to .patch file
libargon2.spec | 11 +++--------
makefile.patch | 26 ++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 8 deletions(-)
---
diff --git a/libargon2.spec b/libargon2.spec
index 0b00f4c..bf491d2 100644
--- a/libargon2.spec
+++ b/libargon2.spec
@@ -11,6 +11,7 @@ License: Apache-2.0 CC0-1.0
Group: Libraries
Source0: https://github.com/P-H-C/phc-winner-argon2/archive/%{version}/%{name}-%{version}.tar.gz
# Source0-md5: bd3476cb8eac9d521a4e0e04d653f5a8
+Patch0: makefile.patch
URL: https://github.com/P-H-C/phc-winner-argon2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -54,16 +55,10 @@ Statyczna biblioteka %{name}.
%prep
%setup -q -n phc-winner-argon2-%{version}
-
-%if %{without static_libs}
-sed -i -e 's/LIBRARIES = \$(LIB_SH) \$(LIB_ST)/LIBRARIES = \$(LIB_SH)/' Makefile
-%endif
-sed -i -e 's/-O3 //' Makefile
-sed -i -e 's/-g //' Makefile
-sed -i -e "s/-march=\$(OPTTARGET) /%{rpmcflags} /" Makefile
-sed -i -e 's/CFLAGS += -march=\$(OPTTARGET)//' Makefile
+%patch0 -p1
%build
+CFLAGS="%{rpmcflags}" \
%{__make} \
CC="%{__cc}"
diff --git a/makefile.patch b/makefile.patch
new file mode 100644
index 0000000..a8ab0e4
--- /dev/null
+++ b/makefile.patch
@@ -0,0 +1,26 @@
+--- phc-winner-argon2-20161029/Makefile 2016-10-29 12:24:03.000000000 +0300
++++ phc-winner-argon2-20161029/Makefile 2017-08-23 08:59:46.258100103 +0300
+@@ -27,12 +27,12 @@
+ SRC_GENKAT = src/genkat.c
+ OBJ = $(SRC:.c=.o)
+
+-CFLAGS += -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc
++CFLAGS += -std=c89 -pthread -Wall -Iinclude -Isrc
+ CI_CFLAGS := $(CFLAGS) -Werror=declaration-after-statement -D_FORTIFY_SOURCE=2 \
+ -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM
+
+ OPTTARGET ?= native
+-OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \
++OPTTEST := $(shell $(CC) -Iinclude -Isrc src/opt.c -c \
+ -o /dev/null 2>/dev/null; echo $$?)
+ # Detect compatible platform
+ ifneq ($(OPTTEST), 0)
+@@ -40,7 +40,7 @@
+ SRC += src/ref.c
+ else
+ $(info Building with optimizations for $(OPTTARGET))
+- CFLAGS += -march=$(OPTTARGET)
++
+ SRC += src/opt.c
+ endif
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libargon2.git/commitdiff/86c6bb9968b47352160f6ecbe384d8c6fc542475
More information about the pld-cvs-commit
mailing list