From dd60137393702838ccdeafa63ed679ebc44b7f7f5a1da0a6f3cdb5e9becd80ee Mon Sep 17 00:00:00 2001 From: Christian Wittmer Date: Wed, 8 Feb 2012 12:40:10 +0000 Subject: [PATCH] Accepting request 103304 from home:computersalat:devel:sysmgmnt fix pre/post scripts OBS-URL: https://build.opensuse.org/request/show/103304 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=15 --- cfengine.changes | 6 ++++++ cfengine.spec | 27 ++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/cfengine.changes b/cfengine.changes index 69697c2..97760e3 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Feb 8 11:03:06 UTC 2012 - chris@computersalat.de + +- fix pre/post scripts + * RHEL/CentOS does not know "SuSE macros" :( + ------------------------------------------------------------------- Tue Feb 7 12:20:19 UTC 2012 - chris@computersalat.de diff --git a/cfengine.spec b/cfengine.spec index 797e8b5..e80e3c0 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -16,6 +16,7 @@ # + Name: cfengine %define libname libpromises %define libsoname %{libname}1 @@ -178,8 +179,13 @@ done #{__rm} -rf %{buildroot}/%{_libdir}/libpromises.a %preun +%if 0%{?suse_version} %stop_on_removal cf-monitord %stop_on_removal cf-execd +%else +/etc/init.d/cf-execd stop +/etc/init.d/cf-monitord stop +%endif %post %if 0%{?suse_version} @@ -195,6 +201,10 @@ done %postun %if 0%{?suse_version} +%insserv_cleanup +for i in execd monitord; do + %restart_on_update cf-${i} +done %if 0%{?suse_version} > 1010 %install_info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %else @@ -202,18 +212,25 @@ done %endif %else %install_info_delete --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz -%endif -%insserv_cleanup -/sbin/ldconfig -for i in execd monitord serverd; do - %restart_on_update cf-${i} +for i in execd monitord; do + /etc/init.d/cf-${i} restart done +%endif +/sbin/ldconfig %preun server +%if 0%{?suse_version} %stop_on_removal cf-serverd +%else +/etc/init.d/cf-serverd stop +%endif %postun server +%if 0%{?suse_version} %restart_on_update cf-serverd +%else +/etc/init.d/cf-serverd restart +%endif %post -n %{libsoname} -p /sbin/ldconfig