rpms/memcached/devel memcached.spec,1.24,1.25 memcached.sysv,1.3,1.4

jorton jorton at fedoraproject.org
Thu May 27 09:52:04 UTC 2010


Author: jorton

Update of /cvs/pkgs/rpms/memcached/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv9267

Modified Files:
	memcached.spec memcached.sysv 
Log Message:
* Wed May 26 2010 Joe Orton <jorton at redhat.com> - 0:1.4.5-2
- LSB compliance fixes for init script
- don't run the test suite as root
- ensure a constant timestamp on the sysconfig file



Index: memcached.spec
===================================================================
RCS file: /cvs/pkgs/rpms/memcached/devel/memcached.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- memcached.spec	5 Apr 2010 06:04:50 -0000	1.24
+++ memcached.spec	27 May 2010 09:52:03 -0000	1.25
@@ -3,7 +3,7 @@
 
 Name:           memcached
 Version:        1.4.5
-Release:        1%{?dist}
+Release:        2%{?dist}
 Epoch:		0
 Summary:        High Performance, Distributed Memory Object Cache
 
@@ -55,10 +55,13 @@ memcached binary include files.
 make %{?_smp_mflags}
 
 %check
-# remove failing test that doesn't work in
-# build systems
-rm -f t/daemonize.t 
-make test
+# Parts of the test suite only succeed as non-root.
+if [ `id -u` -ne 0 ]; then
+  # remove failing test that doesn't work in
+  # build systems
+  rm -f t/daemonize.t 
+  make test
+fi
 
 %install
 rm -rf %{buildroot}
@@ -82,6 +85,9 @@ CACHESIZE="64"
 OPTIONS=""
 EOF
 
+# Constant timestamp on the config file.
+touch -r %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
+
 # pid directory
 mkdir -p %{buildroot}/%{_localstatedir}/run/memcached
 
@@ -133,6 +139,11 @@ exit 0
 %{_includedir}/memcached/*
 
 %changelog
+* Wed May 26 2010 Joe Orton <jorton at redhat.com> - 0:1.4.5-2
+- LSB compliance fixes for init script
+- don't run the test suite as root
+- ensure a constant timestamp on the sysconfig file
+
 * Sun Apr  4 2010 Paul Lindner <lindner at inuus.com> - 0:1.4.5-1
 - Upgrade to upstream memcached-1.4.5 (http://code.google.com/p/memcached/wiki/ReleaseNotes145)
 


Index: memcached.sysv
===================================================================
RCS file: /cvs/pkgs/rpms/memcached/devel/memcached.sysv,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- memcached.sysv	22 Dec 2007 13:16:56 -0000	1.3
+++ memcached.sysv	27 May 2010 09:52:04 -0000	1.4
@@ -32,27 +32,28 @@ fi
 
 RETVAL=0
 prog="memcached"
+pidfile=${PIDFILE-/var/run/memcached/memcached.pid}
+lockfile=${LOCKFILE-/var/lock/subsys/memcached}
 
 start () {
 	echo -n $"Starting $prog: "
-	# insure that /var/run/memcached has proper permissions
-    if [ "`stat -c %U /var/run/memcached`" != "$USER" ]; then
-        chown $USER /var/run/memcached
-    fi
+	# Ensure that /var/run/memcached has proper permissions
+	if [ "`stat -c %U /var/run/memcached`" != "$USER" ]; then
+		chown $USER /var/run/memcached
+	fi
 
-	daemon --pidfile /var/run/memcached/memcached.pid memcached -d -p $PORT -u $USER  -m $CACHESIZE -c $MAXCONN -P /var/run/memcached/memcached.pid $OPTIONS
+	daemon --pidfile ${pidfile} memcached -d -p $PORT -u $USER  -m $CACHESIZE -c $MAXCONN -P ${pidfile} $OPTIONS
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
+	[ $RETVAL -eq 0 ] && touch ${lockfile}
 }
 stop () {
 	echo -n $"Stopping $prog: "
-	killproc -p /var/run/memcached/memcached.pid /usr/bin/memcached
+	killproc -p ${pidfile} /usr/bin/memcached
 	RETVAL=$?
 	echo
 	if [ $RETVAL -eq 0 ] ; then
-	    rm -f /var/lock/subsys/memcached
-	    rm -f /var/run/memcached.pid
+		rm -f ${lockfile} ${pidfile}
 	fi
 }
 
@@ -71,17 +72,19 @@ case "$1" in
 	stop
 	;;
   status)
-	status memcached
+	status -p ${pidfile} memcached
+	RETVAL=$?
 	;;
   restart|reload|force-reload)
 	restart
 	;;
-  condrestart)
-	[ -f /var/lock/subsys/memcached ] && restart || :
+  condrestart|try-restart)
+	[ -f ${lockfile} ] && restart || :
 	;;
   *)
-	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
-	exit 1
+	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart}"
+	RETVAL=2
+        ;;
 esac
 
-exit $?
+exit $RETVAL



More information about the scm-commits mailing list