From 206cbe332f8c815ecac23ac2a3224cbd3f819019 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 26 Sep 2017 09:01:18 +0200 Subject: simplify build, synced from Fedora --- ...-4.0-deps-library-fPIC-performance-tuning.patch | 24 --------------------- 0003-redis-3.2.5-use-system-jemalloc.patch | 15 ------------- redis.spec | 25 ++++++++++++++-------- 3 files changed, 16 insertions(+), 48 deletions(-) delete mode 100644 0002-redis-4.0-deps-library-fPIC-performance-tuning.patch delete mode 100644 0003-redis-3.2.5-use-system-jemalloc.patch diff --git a/0002-redis-4.0-deps-library-fPIC-performance-tuning.patch b/0002-redis-4.0-deps-library-fPIC-performance-tuning.patch deleted file mode 100644 index b2ddf22..0000000 --- a/0002-redis-4.0-deps-library-fPIC-performance-tuning.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up ./deps/linenoise/Makefile.pic ./deps/linenoise/Makefile ---- ./deps/linenoise/Makefile.pic 2015-12-23 13:35:32.000000000 +0100 -+++ ./deps/linenoise/Makefile 2016-01-15 16:44:52.561582851 +0100 -@@ -2,7 +2,7 @@ STD= - WARN= -Wall - OPT= -Os - --R_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) -+R_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) -fPIC - R_LDFLAGS= $(LDFLAGS) - DEBUG= -g - -diff -up ./deps/Makefile.pic ./deps/Makefile ---- ./deps/Makefile.pic 2015-12-23 13:35:32.000000000 +0100 -+++ ./deps/Makefile 2016-01-15 16:44:52.561582851 +0100 -@@ -59,7 +59,7 @@ ifeq ($(uname_S),SunOS) - LUA_CFLAGS= -D__C99FEATURES__=1 - endif - --LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' $(CFLAGS) -+LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' $(CFLAGS) -fPIC - LUA_LDFLAGS+= $(LDFLAGS) - # lua's Makefile defines AR="ar rcu", which is unusual, and makes it more - # challenging to cross-compile lua (and redis). These defines make it easier diff --git a/0003-redis-3.2.5-use-system-jemalloc.patch b/0003-redis-3.2.5-use-system-jemalloc.patch deleted file mode 100644 index f8d254c..0000000 --- a/0003-redis-3.2.5-use-system-jemalloc.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up src/Makefile.jem src/Makefile ---- src/Makefile.jem 2016-10-27 11:00:29.486075147 +0200 -+++ src/Makefile 2016-10-27 11:02:33.554729427 +0200 -@@ -103,9 +103,8 @@ ifeq ($(MALLOC),tcmalloc_minimal) - endif - - ifeq ($(MALLOC),jemalloc) -- DEPENDENCY_TARGETS+= jemalloc -- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include -- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -+ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE -I/usr/include/jemalloc -+ FINAL_LIBS+= -ljemalloc -ldl - endif - - REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) diff --git a/redis.spec b/redis.spec index 6f6451c..74ab053 100644 --- a/redis.spec +++ b/redis.spec @@ -34,7 +34,7 @@ Name: redis Version: 4.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A persistent key-value database Group: Applications/Databases @@ -56,8 +56,6 @@ Source9: %{name}-limit-init # Update configuration for Fedora Patch0: 0001-redis-3.2-redis-conf.patch -Patch1: 0002-redis-4.0-deps-library-fPIC-performance-tuning.patch -Patch2: 0003-redis-3.2.5-use-system-jemalloc.patch # https://github.com/antirez/redis/pull/3491 - man pages Patch3: %{name}-pr3491.patch @@ -82,6 +80,9 @@ Requires(preun): chkconfig Requires(preun): initscripts Requires(postun): initscripts %endif +Provides: bundled(hiredis) +Provides: bundled(lua-libs) +Provides: bundled(linenoise) %description @@ -133,8 +134,6 @@ and removal, status checks, resharding, rebalancing, and other operations. %endif %patch0 -p1 -b .rpmconf -%patch1 -p1 -b .pic -%patch2 -p0 -b .jem %patch3 -p1 %patch4 -p1 -b .old @@ -144,11 +143,15 @@ sed -i -e 's|\t@|\t|g' deps/lua/src/Makefile sed -i -e 's|$(QUIET_CC)||g' src/Makefile sed -i -e 's|$(QUIET_LINK)||g' src/Makefile sed -i -e 's|$(QUIET_INSTALL)||g' src/Makefile +# Use system jemalloc library +sed -i -e '/cd jemalloc && /d' deps/Makefile +sed -i -e 's|../deps/jemalloc/lib/libjemalloc.a|-ljemalloc -ldl|g' src/Makefile +sed -i -e 's|-I../deps/jemalloc.*|-DJEMALLOC_NO_DEMANGLE -I/usr/include/jemalloc|g' src/Makefile # Ensure deps are built with proper flags -sed -i -e 's|$(CFLAGS)|%{optflags}|g' deps/Makefile +sed -i -e 's|$(CFLAGS)|%{optflags} -fPIC|g' deps/Makefile sed -i -e 's|OPTIMIZATION?=-O3|OPTIMIZATION=%{optflags}|g' deps/hiredis/Makefile sed -i -e 's|$(LDFLAGS)|%{?__global_ldflags}|g' deps/hiredis/Makefile -sed -i -e 's|$(CFLAGS)|%{optflags}|g' deps/linenoise/Makefile +sed -i -e 's|$(CFLAGS)|%{optflags} -fPIC|g' deps/linenoise/Makefile sed -i -e 's|$(LDFLAGS)|%{?__global_ldflags}|g' deps/linenoise/Makefile @@ -170,7 +173,8 @@ make %{?_smp_mflags} V=1 \ # with a modified Jemalloc like the one shipped by default with the Redis source distribution sed -e '/memefficiency/d' -i tests/test_helper.tcl -make test +# https://github.com/antirez/redis/issues/1417 (for "taskset -c 1") +taskset -c 1 make test ||: make test-sentinel %else : Test disabled, missing '--with tests' option. @@ -186,7 +190,7 @@ install -d -m 750 %{buildroot}%{_localstatedir}/lib/%{name} install -d -m 750 %{buildroot}%{_localstatedir}/log/%{name} %if %{with_systemd} -# Install systemd unit +# Install systemd unit files. install -p -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}-sentinel.service # this folder requires systemd >= 204 @@ -303,6 +307,9 @@ fi %changelog +* Tue Sep 26 2017 Remi Collet - 4.0.2-2 +- simplify build, synced from Fedora + * Thu Sep 21 2017 Remi Collet - 4.0.2-1 - Redis 4.0.2 - Released Thu Sep 21 15:47:53 CEST 2017 - Upgrade urgency HIGH: Several potentially critical bugs fixed. -- cgit