11
0

Accepting request 162573 from home:dirkmueller:branches:network:messaging:amqp

------------------------------------------------------------------
- Change init script to properly daemonize (patch by jdsn) (bnc#807540)

- Added systemd .service file

OBS-URL: https://build.opensuse.org/request/show/162573
OBS-URL: https://build.opensuse.org/package/show/network:messaging:amqp/rabbitmq-server?expand=0&rev=16
This commit is contained in:
Ralf Haferkamp
2013-04-04 09:48:47 +00:00
committed by Git OBS Bridge
parent 824648e915
commit 150d13883c
4 changed files with 54 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package rabbitmq-server
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -37,6 +37,7 @@ Source2: rabbitmq-script-wrapper
Source3: rabbitmq-server.logrotate
Source4: rabbitmq-server.ocf
Source5: rabbitmq-server.sysconfig
Source6: rabbitmq-server.service
Patch0: no-nmap.patch
Patch1: no-remove-common.patch
BuildRequires: erlang
@@ -57,6 +58,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(pre): pwdutils
Requires(pre): %fillup_prereq
Requires(pre): %insserv_prereq
%if 0%{?suse_version} > 1140
BuildRequires: systemd
%{?systemd_requires}
%define have_systemd 1
%endif
# Do not use noarch since the Erlang packaging does not really allow that
#BuildArch: noarch
@@ -111,6 +117,9 @@ 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
%define _rabbit_wrapper %{_builddir}/`basename %{SOURCE2}`
@@ -155,17 +164,29 @@ getent passwd rabbitmq >/dev/null || useradd -r -g rabbitmq \
-d %{_localstatedir}/lib/rabbitmq \
-s /sbin/nologin \
-c "user for RabbitMQ messaging server" rabbitmq
%if 0%{?have_systemd}
%service_add_pre %{name}.service
%endif
exit 0
%post
%fillup_and_insserv rabbitmq-server
%if 0%{?have_systemd}
%service_add_post %{name}.service
%endif
%preun
%stop_on_removal rabbitmq-server
%if 0%{?have_systemd}
%service_del_preun %{name}.service
%endif
%postun
%restart_on_update rabbitmq-server
%insserv_cleanup
%if 0%{?have_systemd}
%service_del_postun %{name}.service
%endif
%files -f ../filelist.%{name}.rpm
%defattr(-,root,root,-)
@@ -178,6 +199,9 @@ exit 0
%{_rabbit_erllibdir}
%{_initddir}/rabbitmq-server
%{_sbindir}/rcrabbitmq-server
%if 0%{?have_systemd}
%{_unitdir}/%{name}.service
%endif
%dir /usr/lib/ocf
%dir /usr/lib/ocf/resource.d
%dir /usr/lib/ocf/resource.d/rabbitmq