rpms/freeipmi/devel freeipmi.spec,1.18,1.19

Jan Šafránek jsafrane at fedoraproject.org
Mon Jun 29 13:50:18 UTC 2009


Author: jsafrane

Update of /cvs/pkgs/rpms/freeipmi/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15206

Modified Files:
	freeipmi.spec 
Log Message:
Fix (de-)installation scripts
Resolves: #507557


Index: freeipmi.spec
===================================================================
RCS file: /cvs/pkgs/rpms/freeipmi/devel/freeipmi.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- freeipmi.spec	22 Jun 2009 12:34:12 -0000	1.18
+++ freeipmi.spec	29 Jun 2009 13:49:48 -0000	1.19
@@ -3,9 +3,9 @@
 #
 
 %if %{?_with_debug:1}%{!?_with_debug:0}
-Release: 1.debug%{?dist}
+Release: 2.debug%{?dist}
 %else
-Release: 1%{?dist}
+Release: 2%{?dist}
 %endif
 
 Name: freeipmi
@@ -20,6 +20,11 @@ Patch3: freeipmi-0.6.4-argmax.patch
 Patch4: freeipmi-0.6.4-pathsep.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: libgcrypt-devel texinfo
+Requires(pre): chkconfig
+Requires(post): chkconfig
+Requires(preun): chkconfig
+# for /sbin/service 
+Requires(preun): initscripts
 Requires(post): info
 Requires(preun): info
 # Necessary as only those archs implement iopl and friends (#368541)
@@ -95,80 +100,42 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
 rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ -x /sbin/install-info ]; then
-   #/sbin/install-info %{_infodir}/freeipmi.info.gz %{_infodir}/dir
-   /sbin/install-info %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir
-fi
+/sbin/install-info %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir || :
 /sbin/ldconfig
 
 %preun
 if [ $1 = 0 ]; then
-   if [ -x /sbin/install-info ]; then
-      #/sbin/install-info --delete %{_infodir}/freeipmi.info.gz %{_infodir}/dir
-      /sbin/install-info --delete %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir
-   fi
+    /sbin/install-info --delete %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir || :
 fi
 
 %postun -p /sbin/ldconfig
 
 %post bmc-watchdog
-if [ "$1" = 1 ]; then
-   if [ -x %{_initrddir}/freeipmi-bmc-watchdog ]; then
-      /sbin/chkconfig --add freeipmi-bmc-watchdog
-      /sbin/chkconfig freeipmi-bmc-watchdog off
-   fi
-fi
-if [ $1 -ge 1 ]; then
-   if [ -x %{_initrddir}/freeipmi-bmc-watchdog ]; then
-      if %{_initrddir}/freeipmi-bmc-watchdog status | grep -q running; then
-         %{_initrddir}/freeipmi-bmc-watchdog restart
-      else
-         %{_initrddir}/freeipmi-bmc-watchdog condrestart
-      fi
-   fi
-fi
+/sbin/chkconfig --add freeipmi-bmc-watchdog
 
 %preun bmc-watchdog
-#
-# Stop bmc-watchdog if it is running 
-#
 if [ "$1" = 0 ]; then
-    if [ -x %{_initrddir}/freeipmi-bmc-watchdog ]; then
-       if %{_initrddir}/freeipmi-bmc-watchdog status | grep -q running; then
-          %{_initrddir}/freeipmi-bmc-watchdog stop
-       fi
-       /sbin/chkconfig --del freeipmi-bmc-watchdog
-    fi
+    /sbin/service freeipmi-bmc-watchdog stop >/dev/null 2>&1
+    /sbin/chkconfig --del freeipmi-bmc-watchdog
 fi
 
-%post ipmidetectd
-if [ "$1" = 1 ]; then
-   if [ -x %{_initrddir}/freeipmi-ipmidetectd ]; then
-      /sbin/chkconfig --add freeipmi-ipmidetectd
-      /sbin/chkconfig freeipmi-ipmidetectd off
-   fi
-fi
-if [ $1 -ge 1 ]; then
-   if [ -x %{_initrddir}/freeipmi-ipmidetectd ]; then
-      if %{_initrddir}/freeipmi-ipmidetectd status | grep -q running; then
-         %{_initrddir}/freeipmi-ipmidetectd restart
-      else
-         %{_initrddir}/freeipmi-ipmidetectd condrestart
-      fi
-   fi
+%postun bmc-watchdog
+if [ "$1" -ge "1" ] ; then
+    /sbin/service freeipmi-bmc-watchdog condrestart >/dev/null 2>&1 || :
 fi
 
+%post ipmidetectd
+/sbin/chkconfig --add freeipmi-ipmidetectd
+
 %preun ipmidetectd
-#
-# Stop ipmidetectd if it is running 
-#
 if [ "$1" = 0 ]; then
-    if [ -x %{_initrddir}/freeipmi-ipmidetectd ]; then
-       if %{_initrddir}/freeipmi-ipmidetectd status | grep -q running; then
-          %{_initrddir}/freeipmi-ipmidetectd stop
-       fi
-       /sbin/chkconfig --del freeipmi-ipmidetectd
-    fi
+    /sbin/service freeipmi-ipmidetectd stop >/dev/null 2>&1
+    /sbin/chkconfig --del freeipmi-ipmidetectd
+fi
+
+%postun ipmidetectd
+if [ "$1" -ge "1" ] ; then
+    /sbin/service/freeipmi-ipmidetectd condrestart >/dev/null 2>&1 || :
 fi
 
 %files
@@ -328,6 +295,9 @@ fi
 %{_mandir}/man8/ipmidetectd.8*
 
 %changelog
+* Mon Jun 29 2009 Jan Safranek <jsafrane at redhat.com> - 0.7.10-2
+- Fix (de-)installation scripts
+
 * Wed Jun 17 2009 Jan Safranek <jsafrane at redhat.com> - 0.7.10-1
 - Update to freeipmi-0.7.10
 




More information about the fedora-extras-commits mailing list