From da39baa677468626325aeabab4fd5f5914c0903abdd745c4a33c2ca529c9ac7b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 30 Apr 2014 00:08:45 +0000 Subject: [PATCH] - do not install init script on systemd distros OBS-URL: https://build.opensuse.org/package/show/network:messaging:amqp/rabbitmq-server?expand=0&rev=44 --- rabbitmq-server.changes | 5 +++++ rabbitmq-server.spec | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/rabbitmq-server.changes b/rabbitmq-server.changes index 105381b..e3516da 100644 --- a/rabbitmq-server.changes +++ b/rabbitmq-server.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 30 00:08:33 UTC 2014 - dmueller@suse.com + +- do not install init script on systemd distros + ------------------------------------------------------------------- Thu Apr 10 10:25:08 UTC 2014 - matwey.kornilov@gmail.com diff --git a/rabbitmq-server.spec b/rabbitmq-server.spec index 91ceb9e..7ac301f 100644 --- a/rabbitmq-server.spec +++ b/rabbitmq-server.spec @@ -119,14 +119,15 @@ make install \ DOC_INSTALL_DIR=%{buildroot}/%{_docdir} \ VERSION=%{version} +%if 0%{?have_systemd} +install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service +%else # Install init scripts install -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initddir}/rabbitmq-server mkdir -p %{buildroot}%{_sbindir} ln -sf %{_initddir}/rabbitmq-server %{buildroot}%{_sbindir}/rcrabbitmq-server mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/ install -p -D -m 644 %{SOURCE5} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rabbitmq-server -%if 0%{?have_systemd} -install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service %endif # Install wrapper scripts @@ -185,23 +186,26 @@ getent passwd rabbitmq >/dev/null || useradd -r -g rabbitmq \ exit 0 %post -%fillup_and_insserv rabbitmq-server %if 0%{?have_systemd} %service_add_post %{name}.service systemd-tmpfiles --create --clean /usr/lib/tmpfiles.d/rabbitmq-server.conf +%else +%fillup_and_insserv rabbitmq-server %endif %preun -%stop_on_removal rabbitmq-server %if 0%{?have_systemd} %service_del_preun %{name}.service +%else +%stop_on_removal rabbitmq-server %endif %postun -%restart_on_update rabbitmq-server -%insserv_cleanup %if 0%{?have_systemd} %service_del_postun %{name}.service +%else +%restart_on_update rabbitmq-server +%insserv_cleanup %endif %files -f ../filelist.%{name}.rpm @@ -213,11 +217,12 @@ systemd-tmpfiles --create --clean /usr/lib/tmpfiles.d/rabbitmq-server.conf %{_rabbit_libdir}/bin %dir %{_rabbit_libdir}/lib %{_rabbit_erllibdir} -%{_initddir}/rabbitmq-server -%{_sbindir}/rcrabbitmq-server %if 0%{?have_systemd} %{_unitdir}/%{name}.service /usr/lib/tmpfiles.d/rabbitmq-server.conf +%else +%{_sbindir}/rcrabbitmq-server +%{_initddir}/rabbitmq-server %endif %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d