3 %bcond_with repcached # repcached support, http://repcached.lab.klab.org/
5 Summary: A high-performance, distributed memory object caching system
6 Summary(pl.UTF-8): Rozproszony, wysokiej wydajności system cache'owania obiektów
11 Group: Networking/Daemons
12 Source0: http://memcached.googlecode.com/files/%{name}-%{version}.tar.gz
13 # Source0-md5: 6d18c6d25da945442fcc1187b3b63b7f
15 Source2: %{name}.sysconfig
16 Source3: %{name}.tmpfiles
17 URL: http://memcached.org/
18 Patch0: repcached.patch
19 BuildRequires: autoconf
20 BuildRequires: automake
21 BuildRequires: libevent-devel >= 1.1
22 BuildRequires: rpmbuild(macros) >= 1.268
23 Requires(post,preun): /sbin/chkconfig
24 Requires(postun): /usr/sbin/groupdel
25 Requires(postun): /usr/sbin/userdel
26 Requires(pre): /bin/id
27 Requires(pre): /usr/bin/getgid
28 Requires(pre): /usr/sbin/groupadd
29 Requires(pre): /usr/sbin/useradd
30 Requires: rc-scripts >= 0.4.1.23
31 Provides: group(memcached)
32 Provides: user(memcached)
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 A high-performance, distributed memory object caching system.
38 %description -l pl.UTF-8
39 Rozproszony, wysokiej wydajności system cache'owania obiektów.
43 %{?with_repcached:%patch0 -p1}
51 %{?with_repcached:--enable-replication} \
56 rm -rf $RPM_BUILD_ROOT
57 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \
58 $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1} \
59 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
61 install -p memcached $RPM_BUILD_ROOT%{_sbindir}
62 cp -p doc/memcached.1 $RPM_BUILD_ROOT%{_mandir}/man1
64 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
65 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
67 install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
70 %groupadd -g 209 %{name}
71 %useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached User" %{name}
74 /sbin/chkconfig --add %{name}
75 %service %{name} restart
78 if [ "$1" = "0" ]; then
79 %service -q %{name} stop
80 /sbin/chkconfig --del %{name}
84 if [ "$1" = "0" ]; then
90 rm -rf $RPM_BUILD_ROOT
93 %defattr(644,root,root,755)
94 %doc AUTHORS README doc/*.txt
95 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
96 %attr(754,root,root) /etc/rc.d/init.d/%{name}
97 %attr(755,root,root) %{_sbindir}/%{name}
98 %{_mandir}/man1/memcached.1*
99 %dir %attr(770,root,memcached) /var/run/memcached
100 /usr/lib/tmpfiles.d/%{name}.conf