2007-12-22 13:16:56 +00:00
|
|
|
%define selinux_variants mls strict targeted
|
|
|
|
%define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp)
|
|
|
|
%define modulename memcached
|
|
|
|
|
|
|
|
%define username memcached
|
|
|
|
%define groupname memcached
|
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
Name: memcached
|
2007-12-22 12:26:17 +00:00
|
|
|
Version: 1.2.4
|
2008-01-27 15:33:48 +00:00
|
|
|
Release: 3%{?dist}
|
2007-07-10 20:00:32 +00:00
|
|
|
Summary: High Performance, Distributed Memory Object Cache
|
|
|
|
|
|
|
|
Group: System Environment/Daemons
|
|
|
|
License: BSD
|
|
|
|
URL: http://www.danga.com/memcached/
|
|
|
|
Source0: http://www.danga.com/memcached/dist/%{name}-%{version}.tar.gz
|
|
|
|
|
|
|
|
# custom init script
|
|
|
|
Source1: memcached.sysv
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
# SELinux files
|
|
|
|
Source10: %{modulename}.te
|
|
|
|
Source11: %{modulename}.fc
|
|
|
|
Source12: %{modulename}.if
|
|
|
|
|
2007-08-06 14:39:45 +00:00
|
|
|
# Fixes
|
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
|
|
|
|
BuildRequires: libevent-devel
|
|
|
|
BuildRequires: perl(Test::More)
|
2007-12-22 13:16:56 +00:00
|
|
|
|
2008-01-27 15:33:48 +00:00
|
|
|
Requires: initscripts
|
|
|
|
Requires: libevent
|
2007-12-22 13:16:56 +00:00
|
|
|
Requires(pre): shadow-utils
|
2007-07-10 20:00:32 +00:00
|
|
|
Requires(post): /sbin/chkconfig
|
|
|
|
Requires(preun): /sbin/chkconfig, /sbin/service
|
|
|
|
Requires(postun): /sbin/service
|
|
|
|
|
|
|
|
%description
|
|
|
|
memcached is a high-performance, distributed memory object caching
|
|
|
|
system, generic in nature, but intended for use in speeding up dynamic
|
|
|
|
web applications by alleviating database load.
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
|
|
|
|
%package selinux
|
|
|
|
Summary: SELinux policy module supporting memcached
|
|
|
|
Group: System Environment/Base
|
|
|
|
BuildRequires: checkpolicy, selinux-policy-devel, hardlink
|
|
|
|
%if "%{selinux_policyver}" != ""
|
|
|
|
Requires: selinux-policy >= %{selinux_policyver}
|
|
|
|
%endif
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
Requires(post): policycoreutils
|
|
|
|
Requires(postun): policycoreutils
|
|
|
|
|
|
|
|
%description selinux
|
|
|
|
SELinux policy module supporting memcached.
|
|
|
|
|
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2007-12-22 13:16:56 +00:00
|
|
|
mkdir SELinux
|
|
|
|
cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} SELinux/
|
2007-07-10 20:00:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%configure --enable-threads
|
|
|
|
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
pushd SELinux
|
|
|
|
for selinuxvariant in %{selinux_variants}; do
|
|
|
|
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
|
|
|
|
mv %{modulename}.pp %{modulename}.pp.${selinuxvariant}
|
|
|
|
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
2007-07-13 12:42:31 +00:00
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%check
|
2007-07-13 12:54:58 +00:00
|
|
|
# remove failing test that doesn't work in
|
|
|
|
# build systems
|
|
|
|
rm -f t/daemonize.t
|
2007-07-10 20:00:32 +00:00
|
|
|
make test
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
|
|
|
|
# remove memcached-debug
|
|
|
|
rm -f %{buildroot}/%{_bindir}/memcached-debug
|
|
|
|
|
|
|
|
# Perl script for monitoring memcached
|
|
|
|
install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool
|
|
|
|
|
|
|
|
# Init script
|
|
|
|
install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/memcached
|
|
|
|
|
|
|
|
# Default configs
|
|
|
|
mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig
|
|
|
|
cat <<EOF >%{buildroot}/%{_sysconfdir}/sysconfig/%{name}
|
|
|
|
PORT="11211"
|
2007-12-22 13:16:56 +00:00
|
|
|
USER="%{username}"
|
2007-07-10 20:00:32 +00:00
|
|
|
MAXCONN="1024"
|
|
|
|
CACHESIZE="64"
|
|
|
|
OPTIONS=""
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# pid directory
|
|
|
|
mkdir -p %{buildroot}/%{_localstatedir}/run/memcached
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
# Install SELinux policy modules
|
|
|
|
pushd SELinux
|
|
|
|
for selinuxvariant in %{selinux_variants}; do
|
|
|
|
install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
|
|
|
|
install -p -m 644 %{modulename}.pp.${selinuxvariant} \
|
|
|
|
%{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Hardlink identical policy module packages together
|
|
|
|
/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
|
|
|
|
|
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%clean
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
%pre
|
|
|
|
getent group %{groupname} >/dev/null || groupadd -r %{groupname}
|
|
|
|
getent passwd %{username} >/dev/null || \
|
|
|
|
useradd -r -g %{groupname} -d %{_localstatedir}/run/memcached \
|
|
|
|
-s /sbin/nologin -c "Memcached daemon" %{username}
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%post
|
|
|
|
/sbin/chkconfig --add %{name}
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%preun
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
/sbin/service %{name} stop > /dev/null 2>&1
|
|
|
|
/sbin/chkconfig --del %{name}
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%postun
|
|
|
|
if [ "$1" -ge 1 ]; then
|
|
|
|
/sbin/service %{name} condrestart > /dev/null 2>&1
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
%post selinux
|
|
|
|
# Install SELinux policy modules
|
|
|
|
for selinuxvariant in %{selinux_variants}
|
|
|
|
do
|
|
|
|
/usr/sbin/semodule -s ${selinuxvariant} -i \
|
|
|
|
%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp &> /dev/null || :
|
|
|
|
done
|
|
|
|
/usr/sbin/semanage port -a -t memcached_port_t -p tcp 11211 &> /dev/null || :
|
|
|
|
/sbin/fixfiles -R %{name} restore || :
|
|
|
|
|
|
|
|
|
|
|
|
%postun selinux
|
|
|
|
# Clean up after package removal
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
/usr/sbin/semanage port -d -t memcached_port_t -p tcp 11211 &> /dev/null || :
|
|
|
|
# Remove SELinux policy modules
|
|
|
|
for selinuxvariant in %{selinux_variants}
|
|
|
|
do
|
|
|
|
/usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} &> /dev/null || :
|
|
|
|
done
|
|
|
|
/sbin/fixfiles -R %{name} restore || :
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc AUTHORS ChangeLog COPYING NEWS README TODO doc/CONTRIBUTORS doc/*.txt
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
%dir %attr(755,%{username},%{groupname}) %{_localstatedir}/run/memcached
|
2007-07-10 20:00:32 +00:00
|
|
|
%{_bindir}/memcached-tool
|
|
|
|
%{_bindir}/memcached
|
|
|
|
%{_mandir}/man1/memcached.1*
|
|
|
|
%{_initrddir}/memcached
|
|
|
|
|
|
|
|
|
2007-12-22 13:16:56 +00:00
|
|
|
%files selinux
|
|
|
|
%defattr(-,root,root,0755)
|
|
|
|
%doc SELinux/*.te SELinux/*.fc SELinux/*.if
|
|
|
|
%{_datadir}/selinux/*/%{modulename}.pp
|
|
|
|
|
|
|
|
|
2007-07-10 20:00:32 +00:00
|
|
|
%changelog
|
2008-01-27 15:33:48 +00:00
|
|
|
* Sun Jan 27 2008 Paul Lindner <lindner@inuus.com> - 1.2.4-3
|
|
|
|
- Adjust libevent dependencies
|
|
|
|
|
|
|
|
* Sat Dec 22 2007 Paul Lindner <lindner@inuus.com> - 1.2.4-2
|
2007-12-22 13:16:56 +00:00
|
|
|
- Upgrade to memcached-1.2.4
|
|
|
|
|
|
|
|
* Fri Sep 07 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.2.3-8
|
|
|
|
- Add selinux policies
|
|
|
|
- Create our own system user
|
|
|
|
|
2007-08-06 15:21:47 +00:00
|
|
|
* Mon Aug 6 2007 Paul Lindner <lindner@inuus.com> - 1.2.3-7
|
2007-08-06 14:21:10 +00:00
|
|
|
- Fix problem with -P and -d flag combo on x86_64
|
|
|
|
- Fix init script for FC-6
|
|
|
|
|
2007-07-13 12:54:58 +00:00
|
|
|
* Fri Jul 13 2007 Paul Lindner <lindner@inuus.com> - 1.2.3-4
|
|
|
|
- Remove test that fails in fedora build system on ppc64
|
2007-07-13 12:42:31 +00:00
|
|
|
|
|
|
|
* Sat Jul 7 2007 root <lindner@inuus.com> - 1.2.3-2
|
2007-07-10 20:00:32 +00:00
|
|
|
- Upgrade to 1.2.3 upstream
|
|
|
|
- Adjust make install to preserve man page timestamp
|
|
|
|
- Conform with LSB init scripts standards, add force-reload
|
|
|
|
|
|
|
|
* Wed Jul 4 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-5
|
|
|
|
- Use /var/run/memcached/ directory to hold PID file
|
|
|
|
|
|
|
|
* Sat May 12 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-4
|
|
|
|
- Remove tabs from spec file, rpmlint reports no more errors
|
|
|
|
|
|
|
|
* Thu May 10 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-3
|
|
|
|
- Enable build-time regression tests
|
|
|
|
- add dependency on initscripts
|
|
|
|
- remove memcached-debug (not needed in dist)
|
|
|
|
- above suggestions from Bernard Johnson
|
|
|
|
|
|
|
|
* Mon May 7 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-2
|
|
|
|
- Tidyness improvements suggested by Ruben Kerkhof in bugzilla #238994
|
|
|
|
|
|
|
|
* Fri May 4 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-1
|
|
|
|
- Initial spec file created via rpmdev-newspec
|