From 9701e10ca6b4c0037daba1b8628b67c945e62c38 Mon Sep 17 00:00:00 2001
From: Steve Dickson <steved@fedoraproject.org>
Date: Tue, 8 Aug 2006 21:43:24 +0000
Subject: [PATCH] - Updated init.d script to look for cachefilesd in /sbin -
 Added postun and preun rules so cachefilesd is stopped and started when    
 the rpm is updated or removed.

---
 cachefilesd.spec | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/cachefilesd.spec b/cachefilesd.spec
index aba78e4..83b7b57 100644
--- a/cachefilesd.spec
+++ b/cachefilesd.spec
@@ -1,6 +1,6 @@
 Name:           cachefilesd
 Version:        0.4
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        CacheFiles userspace management daemon
 Group:          System Environment/Daemons
 License:        GPL
@@ -12,6 +12,8 @@ BuildRequires: automake, autoconf
 Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/chkconfig
 
+Patch1: cachefilesd-0.4-initscript.patch
+
 %description
 The cachefilesd daemon manages the caching files and directory that are
 that are used by network filesystems such a AFS and NFS to  
@@ -20,6 +22,8 @@ do persistent caching to the local disk.
 %prep
 %setup -q
 
+%patch1 -p1
+
 %build
 %ifarch s390 s390x
 PIE="-fPIE"
@@ -50,9 +54,15 @@ rm -rf $RPM_BUILD_ROOT
 
 %preun
 if [ $1 -eq 0 ]; then
+	/sbin/service cachefilesd stop
 	/sbin/chkconfig --del %{name}
 fi
 
+%postun
+if [ "$1" -ge 1 ]; then
+	/sbin/service cachefilesd condrestart > /dev/null
+fi
+
 
 %files
 %defattr(-,root,root)
@@ -63,6 +73,11 @@ fi
 %{_mandir}/*/*
 
 %changelog
+* Tue Aug  8 2006 Steve Dickson <steved@redhat.com> 0.4-3
+- Updated init.d script to look for cachefilesd in /sbin
+- Added postun and preun rules so cachefilesd is stopped
+  and started when the rpm is updated or removed.
+
 * Tue Aug  7 2006 Jesse Keating <jkeating@redhat.com> 0.4-2
 - require /sbin/chkconfig not /usr/bin/chkconfig