rpms/memcached/F-7 memcached.spec, NONE, 1.1 memcached.sysv, NONE, 1.1 sources, 1.1, 1.2

Paul Lindner (plindner) fedora-extras-commits at redhat.com
Mon Jul 16 17:41:35 UTC 2007


Author: plindner

Update of /cvs/pkgs/rpms/memcached/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14310

Modified Files:
	sources 
Added Files:
	memcached.spec memcached.sysv 
Log Message:
prep F-7 build


--- NEW FILE memcached.spec ---
Name:           memcached
Version:        1.2.3
Release:        4%{?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

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  libevent-devel
BuildRequires:  perl(Test::More)
Requires: initscripts
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.

%prep
%setup -q


%build
%configure --enable-threads

make %{?_smp_mflags}


%check
# remove failing test that doesn't work in
# build systems
rm -f t/daemonize.t 
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"
USER="nobody"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""
EOF

# pid directory
mkdir -p %{buildroot}/%{_localstatedir}/run/memcached

%clean
rm -rf %{buildroot}


%post
/sbin/chkconfig --add %{name}

%preun
if [ "$1" = 0 ] ; then
    /sbin/service %{name} stop > /dev/null 2>&1
    /sbin/chkconfig --del %{name}
fi
exit 0

%postun
if [ "$1" -ge 1 ]; then
    /sbin/service %{name} condrestart > /dev/null 2>&1
fi
exit 0


%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README TODO doc/CONTRIBUTORS doc/*.txt
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}

%dir %attr(750,nobody,nobody) %{_localstatedir}/run/memcached
%{_bindir}/memcached-tool
%{_bindir}/memcached
%{_mandir}/man1/memcached.1*
%{_initrddir}/memcached


%changelog
* Fri Jul 13 2007 Paul Lindner <lindner at inuus.com> - 1.2.3-4
- Remove test that fails in fedora build system on ppc64

* Sat Jul  7 2007 root <lindner at inuus.com> - 1.2.3-2
- 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 at inuus.com> - 1.2.2-5
- Use /var/run/memcached/ directory to hold PID file

* Sat May 12 2007 Paul Lindner <lindner at inuus.com> - 1.2.2-4
- Remove tabs from spec file, rpmlint reports no more errors

* Thu May 10 2007 Paul Lindner <lindner at 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 at inuus.com> - 1.2.2-2
- Tidyness improvements suggested by Ruben Kerkhof in bugzilla #238994

* Fri May  4 2007 Paul Lindner <lindner at inuus.com> - 1.2.2-1
- Initial spec file created via rpmdev-newspec


--- NEW FILE memcached.sysv ---
#! /bin/sh
#
# chkconfig: - 55 45
# description:	The memcached daemon is a network memory cache service.
# processname: memcached
# config: /etc/sysconfig/memcached

# Standard LSB functions
. /lib/lsb/init-functions

# Source function library.
. /etc/init.d/functions

PORT=11211
USER=nobody
MAXCONN=1024
CACHESIZE=64
OPTIONS=""

if [ -f /etc/sysconfig/memcached ];then 
	. /etc/sysconfig/memcached
fi

# Check that networking is up.
if [ "$NETWORKING" = "no" ]
then
	exit 0
fi

RETVAL=0
prog="memcached"

start () {
	echo -n $"Starting $prog: "
	# insure that /var/run/memcached has proper permissions
        chown $USER /var/run/memcached

	daemon --pidfile /var/run/memcached/memcached.pid memcached -d -p $PORT -u $USER  -m $CACHESIZE -c $MAXCONN -P /var/run/memcached/memcached.pid $OPTIONS
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
}
stop () {
	echo -n $"Stopping $prog: "
	killproc -p /var/run/memcached/memcached.pid /usr/bin/memcached
	RETVAL=$?
	echo
	if [ $RETVAL -eq 0 ] ; then
	    rm -f /var/lock/subsys/memcached
	    rm -f /var/run/memcached.pid
	fi
}

restart () {
        stop
        start
}


# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	status memcached
	;;
  restart|reload|force-reload)
	restart
	;;
  condrestart)
	[ -f /var/lock/subsys/memcached ] && restart || :
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
	exit 1
esac

exit $?


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/memcached/F-7/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	10 Jul 2007 16:13:40 -0000	1.1
+++ sources	16 Jul 2007 17:41:01 -0000	1.2
@@ -0,0 +1 @@
+efbc9ef1cf7dbc93a3ddceea541968c9  memcached-1.2.3.tar.gz




More information about the scm-commits mailing list