]> git.pld-linux.org Git - packages/libargon2.git/commitdiff
move sed patching to .patch file
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 23 Aug 2017 06:06:49 +0000 (09:06 +0300)
committerElan Ruusamäe <glen@pld-linux.org>
Wed, 23 Aug 2017 06:06:49 +0000 (09:06 +0300)
libargon2.spec
makefile.patch [new file with mode: 0644]

index 0b00f4c1de7323c7d7c7eb3721e631889717cb45..bf491d23fbfb741733717ccd5babd587f1acd035 100644 (file)
@@ -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 (file)
index 0000000..a8ab0e4
--- /dev/null
@@ -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
This page took 0.091418 seconds and 4 git commands to generate.