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: 50ee313639531d4d2f8eb9c688f58948
15 Source2: %{name}.sysconfig
16 URL: http://memcached.org/
17 Patch0: repcached.patch
18 BuildRequires: autoconf
19 BuildRequires: automake
20 BuildRequires: libevent-devel >= 1.1
21 BuildRequires: rpmbuild(macros) >= 1.268
22 Requires(post,preun): /sbin/chkconfig
23 Requires(postun): /usr/sbin/groupdel
24 Requires(postun): /usr/sbin/userdel
25 Requires(pre): /bin/id
26 Requires(pre): /usr/bin/getgid
27 Requires(pre): /usr/sbin/groupadd
28 Requires(pre): /usr/sbin/useradd
29 Requires: rc-scripts >= 0.4.1.23
30 Provides: group(memcached)
31 Provides: user(memcached)
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 A high-performance, distributed memory object caching system.
37 %description -l pl.UTF-8
38 Rozproszony, wysokiej wydajności system cache'owania obiektów.
42 %{?with_repcached:%patch0 -p1}
50 %{?with_repcached:--enable-replication} \
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \
57 $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1}
59 install -p memcached $RPM_BUILD_ROOT%{_sbindir}
60 cp -p doc/memcached.1 $RPM_BUILD_ROOT%{_mandir}/man1
62 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
63 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
66 %groupadd -g 209 %{name}
67 %useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached User" %{name}
70 /sbin/chkconfig --add %{name}
71 %service %{name} restart
74 if [ "$1" = "0" ]; then
75 %service -q %{name} stop
76 /sbin/chkconfig --del %{name}
80 if [ "$1" = "0" ]; then
86 rm -rf $RPM_BUILD_ROOT
89 %defattr(644,root,root,755)
90 %doc AUTHORS README doc/*.txt
91 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
92 %attr(754,root,root) /etc/rc.d/init.d/%{name}
93 %attr(755,root,root) %{_sbindir}/%{name}
94 %{_mandir}/man1/memcached.1*
95 %dir %attr(770,root,memcached) /var/run/memcached