1Name: memcached 2Version: @VERSION@ 3Release: @RELEASE@%{?dist} 4Summary: High Performance, Distributed Memory Object Cache 5 6Group: System Environment/Daemons 7License: BSD 8URL: http://memcached.org 9Source0: http://memcached.org/files/%{name}-@[email protected] 10BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 11 12BuildRequires: libevent-devel 13BuildRequires: perl(Test::More) 14BuildRequires: /usr/bin/prove 15Requires: initscripts 16Requires(post): /sbin/chkconfig 17Requires(preun): /sbin/chkconfig, /sbin/service 18Requires(postun): /sbin/service 19 20%description 21memcached is a high-performance, distributed memory object caching 22system, generic in nature, but intended for use in speeding up dynamic 23web applications by alleviating database load. 24 25%prep 26%setup -q -n %{name}-@FULLVERSION@ 27 28 29%build 30%configure 31 32make %{?_smp_mflags} 33 34%check 35make test 36 37%install 38rm -rf %{buildroot} 39make install DESTDIR=%{buildroot} 40 41# remove memcached-debug 42rm -f %{buildroot}/%{_bindir}/memcached-debug 43 44# Perl script for monitoring memcached 45install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool 46 47# Init script 48install -Dp -m0755 scripts/memcached.sysv %{buildroot}%{_initrddir}/memcached 49 50# Default configs 51mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig 52cat <<EOF >%{buildroot}/%{_sysconfdir}/sysconfig/%{name} 53PORT="11211" 54USER="nobody" 55MAXCONN="1024" 56CACHESIZE="64" 57OPTIONS="" 58EOF 59 60# pid directory 61mkdir -p %{buildroot}/%{_localstatedir}/run/memcached 62 63%clean 64rm -rf %{buildroot} 65 66 67%post 68/sbin/chkconfig --add %{name} 69 70%preun 71if [ "$1" = 0 ] ; then 72 /sbin/service %{name} stop > /dev/null 2>&1 73 /sbin/chkconfig --del %{name} 74fi 75exit 0 76 77%postun 78if [ "$1" -ge 1 ]; then 79 /sbin/service %{name} condrestart > /dev/null 2>&1 80fi 81exit 0 82 83 84%files 85%defattr(-,root,root,-) 86%doc AUTHORS ChangeLog COPYING NEWS README.md doc/CONTRIBUTORS doc/*.txt 87%config(noreplace) %{_sysconfdir}/sysconfig/%{name} 88 89%dir %attr(750,nobody,nobody) %{_localstatedir}/run/memcached 90%{_bindir}/memcached-tool 91%{_bindir}/memcached 92%{_mandir}/man1/memcached.1* 93%{_initrddir}/memcached 94%{_includedir}/memcached 95 96%changelog 97* Mon Nov 2 2009 Dormando <[email protected]> - 1.4.3-1 98- Fix autogen more. 99 100* Sat Aug 29 2009 Dustin Sallings <[email protected]> - 1.4.1-1 101- Autogenerate the version number from tags. 102 103* Wed Jul 4 2007 Paul Lindner <[email protected]> - 1.2.2-5 104- Use /var/run/memcached/ directory to hold PID file 105 106* Sat May 12 2007 Paul Lindner <[email protected]> - 1.2.2-4 107- Remove tabs from spec file, rpmlint reports no more errors 108 109* Thu May 10 2007 Paul Lindner <[email protected]> - 1.2.2-3 110- Enable build-time regression tests 111- add dependency on initscripts 112- remove memcached-debug (not needed in dist) 113- above suggestions from Bernard Johnson 114 115* Mon May 7 2007 Paul Lindner <[email protected]> - 1.2.2-2 116- Tidyness improvements suggested by Ruben Kerkhof in bugzilla #238994 117 118* Fri May 4 2007 Paul Lindner <[email protected]> - 1.2.2-1 119- Initial spec file created via rpmdev-newspec 120