From 269f086a4e1c4a2807b1ad1b124f31ad513bb46e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 28 Feb 2018 16:46:21 +0100 Subject: Update to 1.5.6 Add systemd instancing support --- memcached-format_errors.patch | 32 -------------------------------- memcached-unit.patch | 17 ++++++++++++++--- memcached.spec | 30 +++++++++++++++++++++--------- 3 files changed, 35 insertions(+), 44 deletions(-) delete mode 100644 memcached-format_errors.patch diff --git a/memcached-format_errors.patch b/memcached-format_errors.patch deleted file mode 100644 index 53a9c65..0000000 --- a/memcached-format_errors.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit aa5cc9ad74c871970c2d93c114e1d2c125b63e81 -Author: Miroslav Lichvar -Date: Tue Jan 30 13:28:08 2018 +0100 - - fix gcc warnings - -diff --git a/items.c b/items.c -index 400048b..519764f 100644 ---- a/items.c -+++ b/items.c -@@ -925,7 +925,7 @@ void item_stats_sizes(ADD_STAT add_stats, void *c) { - int i; - for (i = 0; i < stats_sizes_buckets; i++) { - if (stats_sizes_hist[i] != 0) { -- char key[8]; -+ char key[12]; - snprintf(key, sizeof(key), "%d", i * 32); - APPEND_STAT(key, "%u", stats_sizes_hist[i]); - } -diff --git a/memcached.c b/memcached.c -index a8a724c..dba7941 100644 ---- a/memcached.c -+++ b/memcached.c -@@ -3338,7 +3338,7 @@ static void process_stats_conns(ADD_STAT add_stats, void *c) { - int i; - char key_str[STAT_KEY_LEN]; - char val_str[STAT_VAL_LEN]; -- char conn_name[MAXPATHLEN + sizeof("unix:")]; -+ char conn_name[MAXPATHLEN + sizeof("unix:") + sizeof("65535")]; - int klen = 0, vlen = 0; - - assert(add_stats); diff --git a/memcached-unit.patch b/memcached-unit.patch index 103cda3..8d69abb 100644 --- a/memcached-unit.patch +++ b/memcached-unit.patch @@ -1,6 +1,6 @@ -diff -up memcached-1.4.28/scripts/memcached.service.unit memcached-1.4.28/scripts/memcached.service ---- memcached-1.4.28/scripts/memcached.service.unit 2016-07-02 03:14:25.000000000 +0200 -+++ memcached-1.4.28/scripts/memcached.service 2016-07-12 13:54:54.275782170 +0200 +diff -up memcached-1.5.6/scripts/memcached.service.unit memcached-1.5.6/scripts/memcached.service +--- memcached-1.5.6/scripts/memcached.service.unit 2018-02-27 20:19:52.000000000 +0100 ++++ memcached-1.5.6/scripts/memcached.service 2018-02-28 16:28:49.265509810 +0100 @@ -11,6 +11,7 @@ [Unit] @@ -8,4 +8,15 @@ diff -up memcached-1.4.28/scripts/memcached.service.unit memcached-1.4.28/script +Before=httpd.service After=network.target + [Service] +diff -up memcached-1.5.6/scripts/memcached@.service.unit memcached-1.5.6/scripts/memcached@.service +--- memcached-1.5.6/scripts/memcached@.service.unit 2018-02-28 16:29:17.820655918 +0100 ++++ memcached-1.5.6/scripts/memcached@.service 2018-02-28 16:29:24.882692052 +0100 +@@ -15,6 +15,7 @@ + + [Unit] + Description=memcached daemon ++Before=httpd.service + After=network.target + [Service] diff --git a/memcached.spec b/memcached.spec index 1172b75..d767ab8 100644 --- a/memcached.spec +++ b/memcached.spec @@ -1,5 +1,5 @@ # remirepo spec file for memcached -# lastest version with SASL support enabled, from: +# lastest version with SASL and extstore support enabled, from: # # Fedora spec file for memcached # @@ -29,7 +29,7 @@ %global with_tests %{?_with_tests:1}%{!?_with_tests:0} Name: memcached -Version: 1.5.5 +Version: 1.5.6 Release: 1%{?dist} Epoch: 0 Summary: High Performance, Distributed Memory Object Cache @@ -46,13 +46,12 @@ Source2: memcached.sysv Source3: memcached.service Patch1: memcached-unit.patch -Patch2: memcached-format_errors.patch BuildRequires: pkgconfig(libevent) >= 2 %if %{with_systemd} BuildRequires: systemd %endif -%if 0%{?fedora} > 22 +%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8 BuildRequires: perl-generators %endif BuildRequires: perl(Test::More), perl(Test::Harness) @@ -95,7 +94,6 @@ access to the memcached binary include files. %prep %setup -q %patch1 -p1 -b .unit -%patch2 -p1 -b .format_errors %build @@ -134,13 +132,22 @@ install -Dp -m0644 scripts/memcached-tool.1 \ %{buildroot}%{_mandir}/man1/memcached-tool.1 %if %{with_systemd} + # Unit file -%if 0%{?fedora} < 25 +%if 0%{?fedora} < 25 && 0%{?rhel} < 8 install -Dp -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/memcached.service %else -install -Dp -m0644 scripts/memcached.service \ - %{buildroot}%{_unitdir}/memcached.service +install -Dp -m0644 scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service +%endif +install -Dp -m0644 scripts/%{name}@.service %{buildroot}%{_unitdir}/%{name}@.service + +# Safer config +%if 0%{?fedora} < 26 && 0%{?rhel} < 8 +sed -e 's/^##safer##/#/g' -i %{buildroot}%{_unitdir}/%{name}*service +%else +sed -e 's/^##safer##//g' -i %{buildroot}%{_unitdir}/%{name}*service %endif + %else # Init script install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/memcached @@ -151,7 +158,7 @@ mkdir -p %{buildroot}/%{_localstatedir}/run/memcached # Default configs -%if 0%{?fedora} < 25 +%if 0%{?fedora} < 25 && 0%{?rhel} < 8 mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig cat <%{buildroot}/%{_sysconfdir}/sysconfig/%{name} PORT="11211" @@ -240,6 +247,7 @@ fi %{_mandir}/man1/memcached.1* %if %{with_systemd} %{_unitdir}/memcached.service +%{_unitdir}/memcached@.service %else %{_initrddir}/memcached %dir %attr(755,%{username},%{groupname}) %{_localstatedir}/run/memcached @@ -251,6 +259,10 @@ fi %changelog +* Wed Feb 28 2018 Remi Collet - 0:1.5.6-1 +- Update to 1.5.6 +- add systemd instancing support + * Tue Feb 13 2018 Remi Collet - 0:1.5.5-1 - Update to 1.5.5 -- cgit