SPECS: pyrss.spec - use %service, use sed in %post

glen glen at pld-linux.org
Sun Mar 12 23:56:12 CET 2006


Author: glen                         Date: Sun Mar 12 22:56:12 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use %service, use sed in %post

---- Files affected:
SPECS:
   pyrss.spec (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SPECS/pyrss.spec
diff -u SPECS/pyrss.spec:1.5 SPECS/pyrss.spec:1.6
--- SPECS/pyrss.spec:1.5	Tue Feb  7 19:47:57 2006
+++ SPECS/pyrss.spec	Sun Mar 12 23:56:06 2006
@@ -12,6 +12,7 @@
 Source2:	%{name}.sysconfig
 Patch0:		%{name}-psyco_fix.patch
 URL:		http://pyrss.jabberstudio.org/
+Requires(post):	sed >= 4.0
 Requires(post,preun):	/sbin/chkconfig
 Requires:	daemon
 Requires:	jabber-common
@@ -50,26 +51,20 @@
 rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ -f /etc/jabber/secret ] ; then
-	SECRET=`cat /etc/jabber/secret`
+if [ -f %{_sysconfdir}/jabber/secret ] ; then
+	SECRET=`cat %{_sysconfdir}/jabber/secret`
 	if [ -n "$SECRET" ] ; then
-        	echo "Updating component authentication secret in pyrss.xml..."
-		perl -pi -e "s/'>password<'/'>$SECRET<'/" /etc/jabber/pyrss.xml
+		echo "Updating component authentication secret in pyrss.xml..."
+		%{__sed} -i -e "s/'>password<'/'>$SECRET<'/" /etc/jabber/pyrss.xml
 	fi
 fi
 
 /sbin/chkconfig --add pyrss
-if [ -r /var/lock/subsys/pyrss ]; then
-	/etc/rc.d/init.d/pyrss restart >&2
-else
-	echo "Run \"/etc/rc.d/init.d/pyrss start\" to start PyRSS."
-fi
+%service pyrss restart "PyRSS"
 
 %preun
 if [ "$1" = "0" ]; then
-	if [ -r /var/lock/subsys/pyrss ]; then
-		/etc/rc.d/init.d/pyrss stop >&2
-	fi
+	%service pyrss stop
 	/sbin/chkconfig --del pyrss
 fi
 
@@ -87,6 +82,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.6  2006/03/12 22:56:06  glen
+- use %service, use sed in %post
+
 Revision 1.5  2006/02/07 18:47:57  hawk
 - added patch fixing bug with psyco module being required
 - works nicely :)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/pyrss.spec?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list