2 # - release notes: https://github.com/memcached/memcached/wiki/ReleaseNotes
4 # - fix x32 build failure:
5 #crawler.c: In function 'crawler_metadump_eval':
6 #crawler.c:229:13: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t {aka long long int}' [-Wformat=]
7 # "key=%s exp=%ld la=%llu cas=%llu fetch=%s\n",
9 #crawler.c:229:13: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t {aka long long int}' [-Wformat=]
12 %bcond_with repcached # repcached support, http://repcached.lab.klab.org/
14 Summary: A high-performance, distributed memory object caching system
15 Summary(pl.UTF-8): Rozproszony, wysokiej wydajności system cache'owania obiektów
20 Group: Networking/Daemons
21 Source0: http://www.memcached.org/files/%{name}-%{version}.tar.gz
22 # Source0-md5: 2d7f6476283cd36e21e521d901d37a8f
24 Source2: %{name}.sysconfig
25 Source3: %{name}.tmpfiles
26 URL: http://memcached.org/
27 Patch0: repcached.patch
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: libevent-devel >= 1.1
31 BuildRequires: rpmbuild(macros) >= 1.268
32 BuildRequires: sed >= 4.0
33 Requires(post,preun): /sbin/chkconfig
34 Requires(postun): /usr/sbin/groupdel
35 Requires(postun): /usr/sbin/userdel
36 Requires(pre): /bin/id
37 Requires(pre): /usr/bin/getgid
38 Requires(pre): /usr/sbin/groupadd
39 Requires(pre): /usr/sbin/useradd
40 Requires: rc-scripts >= 0.4.1.23
41 Provides: group(memcached)
42 Provides: user(memcached)
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 %define _bindir %{_sbindir}
48 A high-performance, distributed memory object caching system.
50 %description -l pl.UTF-8
51 Rozproszony, wysokiej wydajności system cache'owania obiektów.
54 Summary: Files needed for development using memcached protocol
55 Group: Development/Libraries
56 # does not require base
59 Install memcached-devel if you are developing C/C++ applications that
60 require access to the memcached binary include files.
64 %{?with_repcached:%patch0 -p1}
66 sed -nie '1,/^$/p' ChangeLog
69 %{__sed} -i -e 's/-Werror//' configure.ac
78 %{?with_repcached:--enable-replication} \
83 rm -rf $RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \
85 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
88 INSTALL="%{__install} -p" \
89 DESTDIR=$RPM_BUILD_ROOT
91 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
92 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
93 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
96 %groupadd -g 209 %{name}
97 %useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached Daemon" %{name}
100 /sbin/chkconfig --add %{name}
101 %service %{name} restart
104 if [ "$1" = "0" ]; then
105 %service -q %{name} stop
106 /sbin/chkconfig --del %{name}
110 if [ "$1" = "0" ]; then
116 rm -rf $RPM_BUILD_ROOT
119 %defattr(644,root,root,755)
120 %doc AUTHORS README.md ChangeLog doc/*.txt
121 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
122 %attr(754,root,root) /etc/rc.d/init.d/%{name}
123 %attr(755,root,root) %{_sbindir}/%{name}
124 %{_mandir}/man1/memcached.1*
125 %dir %attr(770,root,memcached) /var/run/memcached
126 %{systemdtmpfilesdir}/%{name}.conf
129 %defattr(644,root,root,755)
130 %{_includedir}/%{name}