From c9549dbf85c87a0f948aca86c7910959b3f3ad5d Mon Sep 17 00:00:00 2001 From: Will Woods Date: Mon, 23 Feb 2009 11:09:44 -0500 Subject: Handle initscript better in spec --- debuginfofs.spec | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/debuginfofs.spec b/debuginfofs.spec index af7650f..179c033 100644 --- a/debuginfofs.spec +++ b/debuginfofs.spec @@ -12,8 +12,11 @@ Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) #BuildArch: -BuildRequires: python-devel -Requires: rpm cpio yum wdfs +Requires: wdfs +Requires(post): chkconfig +Requires(preun): chkconfig +Requires(preun): initscripts +Requires(postun): initscripts %description debuginfofs is a network-mountable filesystem that provides the debugging @@ -22,7 +25,7 @@ symbols needed to generate a fully annotated backtrace. %package server Summary: Server setup for debuginfofs Group: Development/Debuggers -Requires: httpd +Requires: rpm cpio httpd %description server Server tools and config files for running a debuginfofs server @@ -39,8 +42,8 @@ Server tools and config files for running a debuginfofs server rm -rf $RPM_BUILD_ROOT #%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT # client -mkdir -p $RPM_BUILD_ROOT{/etc/init.d,/etc/sysconfig} -install -m 0755 debuginfofs.init $RPM_BUILD_ROOT/etc/init.d/debuginfofs +mkdir -p $RPM_BUILD_ROOT{%{_initrddir},/etc/sysconfig} +install -m 0755 debuginfofs.init $RPM_BUILD_ROOT%{_initrddir}/debuginfofs install -m 0644 debuginfofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/debuginfofs # server mkdir -p $RPM_BUILD_ROOT{/etc/httpd/conf.d,/usr/sbin} @@ -53,6 +56,20 @@ install -m 0644 dav-debuginfo.conf $RPM_BUILD_ROOT/etc/httpd/conf.d %clean rm -rf $RPM_BUILD_ROOT +%post +/sbin/chkconfig --add debuginfofs + +%preun +if [ "$1" == "0" ] ; then + /sbin/service debuginfofs stop >/dev/null 2>&1 + /sbin/chkconfig --del debuginfofs +fi + +%postun +if [ "$1" -ge "1" ] ; then + /sbin/service debuginfofs condrestart >/dev/null 2>&1 || : +fi + %files %defattr(-,root,root,-) -- cgit