Fix (de-)installation scripts

Resolves: #507557
This commit is contained in:
Jan Šafránek 2009-06-29 13:49:48 +00:00
parent 6786f73792
commit 393bf4af08

View File

@ -3,9 +3,9 @@
# #
%if %{?_with_debug:1}%{!?_with_debug:0} %if %{?_with_debug:1}%{!?_with_debug:0}
Release: 1.debug%{?dist} Release: 2.debug%{?dist}
%else %else
Release: 1%{?dist} Release: 2%{?dist}
%endif %endif
Name: freeipmi Name: freeipmi
@ -20,6 +20,11 @@ Patch3: freeipmi-0.6.4-argmax.patch
Patch4: freeipmi-0.6.4-pathsep.patch Patch4: freeipmi-0.6.4-pathsep.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libgcrypt-devel texinfo BuildRequires: libgcrypt-devel texinfo
Requires(pre): chkconfig
Requires(post): chkconfig
Requires(preun): chkconfig
# for /sbin/service
Requires(preun): initscripts
Requires(post): info Requires(post): info
Requires(preun): info Requires(preun): info
# Necessary as only those archs implement iopl and friends (#368541) # 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 rm -rf $RPM_BUILD_ROOT
%post %post
if [ -x /sbin/install-info ]; then /sbin/install-info %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir || :
#/sbin/install-info %{_infodir}/freeipmi.info.gz %{_infodir}/dir
/sbin/install-info %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir
fi
/sbin/ldconfig /sbin/ldconfig
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
if [ -x /sbin/install-info ]; then /sbin/install-info --delete %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir || :
#/sbin/install-info --delete %{_infodir}/freeipmi.info.gz %{_infodir}/dir
/sbin/install-info --delete %{_infodir}/freeipmi-faq.info.gz %{_infodir}/dir
fi
fi fi
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%post bmc-watchdog %post bmc-watchdog
if [ "$1" = 1 ]; then /sbin/chkconfig --add freeipmi-bmc-watchdog
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
%preun bmc-watchdog %preun bmc-watchdog
#
# Stop bmc-watchdog if it is running
#
if [ "$1" = 0 ]; then if [ "$1" = 0 ]; then
if [ -x %{_initrddir}/freeipmi-bmc-watchdog ]; then /sbin/service freeipmi-bmc-watchdog stop >/dev/null 2>&1
if %{_initrddir}/freeipmi-bmc-watchdog status | grep -q running; then
%{_initrddir}/freeipmi-bmc-watchdog stop
fi
/sbin/chkconfig --del freeipmi-bmc-watchdog /sbin/chkconfig --del freeipmi-bmc-watchdog
fi fi
%postun bmc-watchdog
if [ "$1" -ge "1" ] ; then
/sbin/service freeipmi-bmc-watchdog condrestart >/dev/null 2>&1 || :
fi fi
%post ipmidetectd %post ipmidetectd
if [ "$1" = 1 ]; then /sbin/chkconfig --add freeipmi-ipmidetectd
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
fi
%preun ipmidetectd %preun ipmidetectd
#
# Stop ipmidetectd if it is running
#
if [ "$1" = 0 ]; then if [ "$1" = 0 ]; then
if [ -x %{_initrddir}/freeipmi-ipmidetectd ]; then /sbin/service freeipmi-ipmidetectd stop >/dev/null 2>&1
if %{_initrddir}/freeipmi-ipmidetectd status | grep -q running; then
%{_initrddir}/freeipmi-ipmidetectd stop
fi
/sbin/chkconfig --del freeipmi-ipmidetectd /sbin/chkconfig --del freeipmi-ipmidetectd
fi fi
%postun ipmidetectd
if [ "$1" -ge "1" ] ; then
/sbin/service/freeipmi-ipmidetectd condrestart >/dev/null 2>&1 || :
fi fi
%files %files
@ -328,6 +295,9 @@ fi
%{_mandir}/man8/ipmidetectd.8* %{_mandir}/man8/ipmidetectd.8*
%changelog %changelog
* Mon Jun 29 2009 Jan Safranek <jsafrane@redhat.com> - 0.7.10-2
- Fix (de-)installation scripts
* Wed Jun 17 2009 Jan Safranek <jsafrane@redhat.com> - 0.7.10-1 * Wed Jun 17 2009 Jan Safranek <jsafrane@redhat.com> - 0.7.10-1
- Update to freeipmi-0.7.10 - Update to freeipmi-0.7.10