Search
j0ke.net Open Build Service
>
Projects
>
home:jg
>
memcached
> Changes
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 8
[-]
[+]
Changed
memcached.spec
@@ -1,38 +1,17 @@ -%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 - Name: memcached Version: 1.4.1 -Release: 1 +Release: 1%{?dist} 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 - -# SELinux files -Source10: %{modulename}.te -Source11: %{modulename}.fc -Source12: %{modulename}.if - -# Fixes - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libevent-devel BuildRequires: perl(Test::More) - Requires: initscripts -Requires: libevent -Requires(pre): shadow-utils Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig, /sbin/service Requires(postun): /sbin/service @@ -42,26 +21,8 @@ system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. - -%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. - - %prep %setup -q -mkdir SELinux -cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} SELinux/ %build @@ -69,25 +30,13 @@ make %{?_smp_mflags} -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 - - %check -# remove failing test that doesn't work in -# build systems -rm -f t/daemonize.t - -#make test +make test %install rm -rf %{buildroot} -make install DESTDIR=%{buildroot} INSTALL="%{__install} -p" +make install DESTDIR=%{buildroot} + # remove memcached-debug rm -f %{buildroot}/%{_bindir}/memcached-debug @@ -95,13 +44,13 @@ install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool # Init script -install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/memcached +install -Dp -m0755 scripts/memcached.sysv %{buildroot}%{_initrddir}/memcached # Default configs mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig cat <<EOF >%{buildroot}/%{_sysconfdir}/sysconfig/%{name} PORT="11211" -USER="%{username}" +USER="nobody" MAXCONN="1024" CACHESIZE="64" OPTIONS="" @@ -110,35 +59,13 @@ # pid directory mkdir -p %{buildroot}/%{_localstatedir}/run/memcached -# 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 - - %clean rm -rf %{buildroot} -%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 - - %post /sbin/chkconfig --add %{name} - %preun if [ "$1" = 0 ] ; then /sbin/service %{name} stop > /dev/null 2>&1 @@ -146,7 +73,6 @@ fi exit 0 - %postun if [ "$1" -ge 1 ]; then /sbin/service %{name} condrestart > /dev/null 2>&1 @@ -154,34 +80,10 @@ exit 0 -%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 - - %files %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING NEWS README TODO doc/CONTRIBUTORS doc/*.txt -%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %dir %attr(750,nobody,nobody) %{_localstatedir}/run/memcached %{_bindir}/memcached-tool @@ -190,41 +92,9 @@ %{_initrddir}/memcached %{_includedir}/memcached - %changelog -* Fri Jul 10 2009 Juergen Gotteswinter <jg@internetx.de> - 1.4.0-1 -- version bump to 1.4.0