- 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
This commit is contained in:
Dirk Mueller 2014-04-30 00:08:45 +00:00 committed by Git OBS Bridge
parent c0a4d088db
commit da39baa677
2 changed files with 18 additions and 8 deletions

View File

@ -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 Thu Apr 10 10:25:08 UTC 2014 - matwey.kornilov@gmail.com

View File

@ -119,14 +119,15 @@ make install \
DOC_INSTALL_DIR=%{buildroot}/%{_docdir} \ DOC_INSTALL_DIR=%{buildroot}/%{_docdir} \
VERSION=%{version} VERSION=%{version}
%if 0%{?have_systemd}
install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service
%else
# Install init scripts # Install init scripts
install -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initddir}/rabbitmq-server install -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initddir}/rabbitmq-server
mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_sbindir}
ln -sf %{_initddir}/rabbitmq-server %{buildroot}%{_sbindir}/rcrabbitmq-server ln -sf %{_initddir}/rabbitmq-server %{buildroot}%{_sbindir}/rcrabbitmq-server
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/ mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/
install -p -D -m 644 %{SOURCE5} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rabbitmq-server 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 %endif
# Install wrapper scripts # Install wrapper scripts
@ -185,23 +186,26 @@ getent passwd rabbitmq >/dev/null || useradd -r -g rabbitmq \
exit 0 exit 0
%post %post
%fillup_and_insserv rabbitmq-server
%if 0%{?have_systemd} %if 0%{?have_systemd}
%service_add_post %{name}.service %service_add_post %{name}.service
systemd-tmpfiles --create --clean /usr/lib/tmpfiles.d/rabbitmq-server.conf systemd-tmpfiles --create --clean /usr/lib/tmpfiles.d/rabbitmq-server.conf
%else
%fillup_and_insserv rabbitmq-server
%endif %endif
%preun %preun
%stop_on_removal rabbitmq-server
%if 0%{?have_systemd} %if 0%{?have_systemd}
%service_del_preun %{name}.service %service_del_preun %{name}.service
%else
%stop_on_removal rabbitmq-server
%endif %endif
%postun %postun
%restart_on_update rabbitmq-server
%insserv_cleanup
%if 0%{?have_systemd} %if 0%{?have_systemd}
%service_del_postun %{name}.service %service_del_postun %{name}.service
%else
%restart_on_update rabbitmq-server
%insserv_cleanup
%endif %endif
%files -f ../filelist.%{name}.rpm %files -f ../filelist.%{name}.rpm
@ -213,11 +217,12 @@ systemd-tmpfiles --create --clean /usr/lib/tmpfiles.d/rabbitmq-server.conf
%{_rabbit_libdir}/bin %{_rabbit_libdir}/bin
%dir %{_rabbit_libdir}/lib %dir %{_rabbit_libdir}/lib
%{_rabbit_erllibdir} %{_rabbit_erllibdir}
%{_initddir}/rabbitmq-server
%{_sbindir}/rcrabbitmq-server
%if 0%{?have_systemd} %if 0%{?have_systemd}
%{_unitdir}/%{name}.service %{_unitdir}/%{name}.service
/usr/lib/tmpfiles.d/rabbitmq-server.conf /usr/lib/tmpfiles.d/rabbitmq-server.conf
%else
%{_sbindir}/rcrabbitmq-server
%{_initddir}/rabbitmq-server
%endif %endif
%dir /usr/lib/ocf %dir /usr/lib/ocf
%dir /usr/lib/ocf/resource.d %dir /usr/lib/ocf/resource.d