From c6cfbad8beef9734af0501e71fd7e1dcd95cccdc Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Jul 13 2012 10:16:28 +0000 Subject: New Upstream Release - 2.8.4 Signed-off-by: Peter Lemenkov --- diff --git a/.gitignore b/.gitignore index bbfd013..9c2b66f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ rabbitmq-server-1.8.0.tar.gz /rabbitmq-server-2.2.0.tar.gz /rabbitmq-server-2.6.0.tar.gz /rabbitmq-server-2.6.1.tar.gz +/rabbitmq-server-2.8.4.tar.gz diff --git a/rabbitmq-server.service b/rabbitmq-server.service new file mode 100644 index 0000000..e56171b --- /dev/null +++ b/rabbitmq-server.service @@ -0,0 +1,17 @@ +[Unit] +Description=RabbitMQ broker +After=syslog.target network.target + +[Service] +Type=simple +User=rabbitmq +Group=rabbitmq +Environment=RABBITMQ_PID_FILE=/var/run/rabbitmq/pid +WorkingDirectory=/var/lib/rabbitmq +ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server +ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmqctl wait /var/run/rabbitmq/pid +ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop +ExecStopPost=/usr/bin/rm /var/run/rabbitmq/pid + +[Install] +WantedBy=multi-user.target diff --git a/rabbitmq-server.spec b/rabbitmq-server.spec index 51c01d3..7f32278 100644 --- a/rabbitmq-server.spec +++ b/rabbitmq-server.spec @@ -1,8 +1,8 @@ %define debug_package %{nil} Name: rabbitmq-server -Version: 2.6.1 -Release: 2%{?dist} +Version: 2.8.4 +Release: 1%{?dist} License: MPLv1.1 Group: Development/Libraries Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.gz @@ -11,14 +11,31 @@ Source2: rabbitmq-script-wrapper Source3: rabbitmq-server.logrotate Source4: rabbitmq-server.ocf Source5: rabbitmq-server.tmpfiles +Source6: rabbitmq-server.service URL: http://www.rabbitmq.com/ BuildArch: noarch -BuildRequires: erlang >= R12B-3, python-simplejson, xmlto, libxslt, python +#BuildRequires: erlang >= R12B-3, python-simplejson, xmlto, libxslt, python +BuildRequires: erlang >= R12B-3, python-simplejson, libxslt, python +%if 0%{?fedora} > 17 +BuildRequires: systemd-units +%endif Requires: erlang >= R12B-3, logrotate BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{_arch}-root Summary: The RabbitMQ server -Requires(post): chkconfig initscripts -Requires(pre): chkconfig initscripts +#Requires(post): chkconfig initscripts +#Requires(pre): chkconfig initscripts +#Initscripts +%if 0%{?fedora} > 16 +# Users and groups +Requires(pre): shadow-utils +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%else +Requires(post): chkconfig +Requires(preun):chkconfig +Requires(preun):initscripts +%endif %description RabbitMQ is an implementation of AMQP, the emerging standard for high @@ -54,7 +71,11 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/rabbitmq/mnesia mkdir -p %{buildroot}%{_localstatedir}/log/rabbitmq #Copy all necessary lib files etc. +%if 0%{?fedora} > 17 +install -p -D -m 0755 %{S:1} %{buildroot}%{_unitdir}/%{name}.service +%else install -p -D -m 0755 %{S:1} %{buildroot}%{_initrddir}/rabbitmq-server +%endif install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmqctl install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmq-server install -p -D -m 0755 %{_rabbit_server_ocf} %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server @@ -78,6 +99,8 @@ install -d %{buildroot}%{_localstatedir}/run/rabbitmq install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf %endif +rm -rf %{buildroot}%{_rabbit_erllibdir}/LICENSE-* + %pre if [ $1 -gt 1 ]; then @@ -97,17 +120,32 @@ if ! getent passwd rabbitmq >/dev/null; then fi %post +%if 0%{?fedora} > 17 +if [ $1 -eq 1 ] ; then + # Initial installation + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +fi +%else /sbin/chkconfig --add %{name} +%endif %preun +%if 0%{?fedora} > 17 +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || : + /bin/systemctl stop %{name}.service > /dev/null 2>&1 || : +fi +%else if [ $1 = 0 ]; then #Complete uninstall - /sbin/service rabbitmq-server stop - /sbin/chkconfig --del rabbitmq-server + /sbin/service %{name} stop > /dev/null 2>&1 + /sbin/chkconfig --del %{name} # We do not remove /var/log and /var/lib directories # Leave rabbitmq user and group fi +%endif # Clean out plugin activation state, both on uninstall and upgrade rm -rf %{_plugins_state_dir} @@ -115,6 +153,18 @@ for ext in rel script boot ; do rm -f %{_rabbit_erllibdir}/ebin/rabbit.$ext done +%if 0%{?fedora} > 17 +%triggerun -- %{name} < 2.8.4 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply opensips +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del %{name} >/dev/null 2>&1 || : +/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : +%endif + %files -f ../%{name}.files %defattr(-,root,root,-) %attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/lib/rabbitmq @@ -122,18 +172,25 @@ done %dir %{_sysconfdir}/rabbitmq %{_rabbit_erllibdir} %{_rabbit_libdir}/bin -%{_initrddir}/rabbitmq-server +%if 0%{?fedora} > 17 +%{_unitdir}/%{name}.service +%else +%{_initrddir}/%{name} +%endif %config(noreplace) %{_sysconfdir}/logrotate.d/rabbitmq-server %if 0%{?fedora} > 14 %config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf %endif %dir %attr(755, rabbitmq, rabbitmq) %{_localstatedir}/run/rabbitmq -%doc LICENSE LICENSE-MPL-RabbitMQ +%doc LICENSE LICENSE-* %clean rm -rf %{buildroot} %changelog +* Thu Jul 12 2012 Peter Lemenkov - 2.8.4-1 +- New Upstream Release - 2.8.4 + * Sat Jan 14 2012 Fedora Release Engineering - 2.6.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild diff --git a/sources b/sources index d2547a5..aeb1b43 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c8b86f2e2a86502932b54e9ced2eb63c rabbitmq-server-2.6.1.tar.gz +a48acd5b65bb019bd5221cb6fab2ceac rabbitmq-server-2.8.4.tar.gz