X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=memcached.spec;h=3a8b0a68de99c607334d92bc0309d94043c6c2e5;hb=68d94add5f486ff185d4d9be468e2319943e7b05;hp=5179fd354f71b42e4135edd6b3332d0c02ac4ebc;hpb=c55b5bfc9d7434abb2914fa7295a1cc9ecdc7626;p=packages%2Fmemcached.git diff --git a/memcached.spec b/memcached.spec index 5179fd3..3a8b0a6 100644 --- a/memcached.spec +++ b/memcached.spec @@ -1,54 +1,74 @@ -# TODO -# - memcached has -P option for pid, but root privs are dropped before -# pid is written, so either run memcached as new uid or hack code to -# write pidfile before changing uid, as rc-script removes pid on -# shutdown anyway. +# +# Conditional build: +%bcond_with repcached # repcached support, http://repcached.lab.klab.org/ + Summary: A high-performance, distributed memory object caching system -Summary(pl): Rozproszony system cache'owania obiektów o wysokiej wydajno¶ci +Summary(pl.UTF-8): Rozproszony, wysokiej wydajności system cache'owania obiektów Name: memcached -Version: 1.1.12 -Release: 2 +Version: 1.4.15 +Release: 1 License: BSD -Vendor: Brad Fitzpatrick Group: Networking/Daemons -Source0: http://www.danga.com/memcached/dist/%{name}-%{version}.tar.gz -# Source0-md5: a1236dad33e9ac6c36d53faa8da61780 +Source0: http://memcached.googlecode.com/files/%{name}-%{version}.tar.gz +# Source0-md5: 36ea966f5a29655be1746bf4949f7f69 Source1: %{name}.init Source2: %{name}.sysconfig -URL: http://www.danga.com/memcached/ +Source3: %{name}.tmpfiles +URL: http://memcached.org/ +Patch0: repcached.patch BuildRequires: autoconf BuildRequires: automake -BuildRequires: libevent-devel -BuildRequires: rpmbuild(macros) >= 1.228 +BuildRequires: libevent-devel >= 1.1 +BuildRequires: rpmbuild(macros) >= 1.268 +Requires(post,preun): /sbin/chkconfig +Requires(postun): /usr/sbin/groupdel +Requires(postun): /usr/sbin/userdel +Requires(pre): /bin/id +Requires(pre): /usr/bin/getgid +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd +Requires: rc-scripts >= 0.4.1.23 +Provides: group(memcached) +Provides: user(memcached) BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description A high-performance, distributed memory object caching system. -%description -l pl -Rozproszony system cache'owania obiektów o wysokiej wydajno¶ci. +%description -l pl.UTF-8 +Rozproszony, wysokiej wydajności system cache'owania obiektów. %prep %setup -q +%{?with_repcached:%patch0 -p1} %build %{__aclocal} %{__autoconf} %{__autoheader} %{__automake} -%configure +%configure \ + %{?with_repcached:--enable-replication} \ + --disable-coverage %{__make} %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} -install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1} +install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \ + $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1} \ + $RPM_BUILD_ROOT/usr/lib/tmpfiles.d + +install -p memcached $RPM_BUILD_ROOT%{_sbindir} +cp -p doc/memcached.1 $RPM_BUILD_ROOT%{_mandir}/man1 -install memcached $RPM_BUILD_ROOT%{_sbindir} -install doc/memcached.1 $RPM_BUILD_ROOT%{_mandir}/man1 +install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} +cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} -install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} -install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} +install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf + +%pre +%groupadd -g 209 %{name} +%useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached Daemon" %{name} %post /sbin/chkconfig --add %{name} @@ -60,13 +80,21 @@ if [ "$1" = "0" ]; then /sbin/chkconfig --del %{name} fi +%postun +if [ "$1" = "0" ]; then + %userremove %{name} + %groupremove %{name} +fi + %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc AUTHORS README TODO doc/*.txt -%attr(755,root,root) %{_sbindir}/* -%{_mandir}/man1/* -%attr(754,root,root) /etc/rc.d/init.d/%{name} +%doc AUTHORS README.md doc/*.txt %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} +%attr(754,root,root) /etc/rc.d/init.d/%{name} +%attr(755,root,root) %{_sbindir}/%{name} +%{_mandir}/man1/memcached.1* +%dir %attr(770,root,memcached) /var/run/memcached +/usr/lib/tmpfiles.d/%{name}.conf