From 7d96b2b7d1548523fd0b2fc53f9955b8325887fc Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Jun 28 2010 00:19:59 +0000 Subject: New upstream release 1.8.0 --- diff --git a/.cvsignore b/.cvsignore index 1c8222b..b038293 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -rabbitmq-server-1.7.2.tar.gz +rabbitmq-server-1.8.0.tar.gz diff --git a/bug22871.patch b/bug22871.patch new file mode 100644 index 0000000..c15dc50 --- /dev/null +++ b/bug22871.patch @@ -0,0 +1,37 @@ +diff -uNr rabbitmq-server-1.8.0/src/rabbit_amqqueue.erl rabbitmq-server-1.8.0patch0/src/rabbit_amqqueue.erl +--- rabbitmq-server-1.8.0/src/rabbit_amqqueue.erl 2010-06-16 13:22:27.000000000 +0100 ++++ rabbitmq-server-1.8.0patch0/src/rabbit_amqqueue.erl 2010-06-28 00:27:35.000000000 +0100 +@@ -110,7 +110,7 @@ + -spec(internal_delete/1 :: (queue_name()) -> 'ok' | not_found()). + -spec(maybe_run_queue_via_backing_queue/2 :: (pid(), (fun ((A) -> A))) -> 'ok'). + -spec(update_ram_duration/1 :: (pid()) -> 'ok'). +--spec(set_ram_duration_target/2 :: (pid(), number()) -> 'ok'). ++-spec(set_ram_duration_target/2 :: (pid(), number() | 'infinity') -> 'ok'). + -spec(set_maximum_since_use/2 :: (pid(), non_neg_integer()) -> 'ok'). + -spec(on_node_down/1 :: (erlang_node()) -> 'ok'). + -spec(pseudo_queue/2 :: (binary(), pid()) -> amqqueue()). +diff -uNr rabbitmq-server-1.8.0/src/rabbit_exchange.erl rabbitmq-server-1.8.0patch0/src/rabbit_exchange.erl +--- rabbitmq-server-1.8.0/src/rabbit_exchange.erl 2010-06-16 13:22:27.000000000 +0100 ++++ rabbitmq-server-1.8.0patch0/src/rabbit_exchange.erl 2010-06-28 00:26:11.000000000 +0100 +@@ -100,7 +100,7 @@ + + %%---------------------------------------------------------------------------- + +--define(INFO_KEYS, [name, type, durable, auto_delete, arguments]. ++-define(INFO_KEYS, [name, type, durable, auto_delete, arguments]). + + recover() -> + Exs = rabbit_misc:table_fold( +diff -uNr rabbitmq-server-1.8.0/src/rabbit_memory_monitor.erl rabbitmq-server-1.8.0patch0/src/rabbit_memory_monitor.erl +--- rabbitmq-server-1.8.0/src/rabbit_memory_monitor.erl 2010-06-16 13:22:27.000000000 +0100 ++++ rabbitmq-server-1.8.0patch0/src/rabbit_memory_monitor.erl 2010-06-28 00:28:44.000000000 +0100 +@@ -90,7 +90,8 @@ + -spec(update/0 :: () -> 'ok'). + -spec(register/2 :: (pid(), {atom(),atom(),[any()]}) -> 'ok'). + -spec(deregister/1 :: (pid()) -> 'ok'). +--spec(report_ram_duration/2 :: (pid(), float() | 'infinity') -> number()). ++-spec(report_ram_duration/2 :: (pid(), float() | 'infinity') -> ++ number() | 'infinity'). + -spec(stop/0 :: () -> 'ok'). + + -endif. diff --git a/rabbitmq-server.ocf b/rabbitmq-server.ocf new file mode 100755 index 0000000..db0ed70 --- /dev/null +++ b/rabbitmq-server.ocf @@ -0,0 +1,374 @@ +#!/bin/sh +## +## OCF Resource Agent compliant rabbitmq-server resource script. +## + +## The contents of this file are subject to the Mozilla Public License +## Version 1.1 (the "License"); you may not use this file except in +## compliance with the License. You may obtain a copy of the License at +## http://www.mozilla.org/MPL/ +## +## Software distributed under the License is distributed on an "AS IS" +## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +## License for the specific language governing rights and limitations +## under the License. +## +## The Original Code is RabbitMQ. +## +## The Initial Developers of the Original Code are LShift Ltd, +## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. +## +## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +## Technologies LLC, and Rabbit Technologies Ltd. +## +## Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift +## Ltd. Portions created by Cohesive Financial Technologies LLC are +## Copyright (C) 2007-2010 Cohesive Financial Technologies +## LLC. Portions created by Rabbit Technologies Ltd are Copyright +## (C) 2007-2010 Rabbit Technologies Ltd. +## +## All Rights Reserved. +## +## Contributor(s): ______________________________________. +## + +## OCF instance parameters +## OCF_RESKEY_multi +## OCF_RESKEY_ctl +## OCF_RESKEY_nodename +## OCF_RESKEY_ip +## OCF_RESKEY_port +## OCF_RESKEY_cluster_config_file +## OCF_RESKEY_config_file +## OCF_RESKEY_log_base +## OCF_RESKEY_mnesia_base +## OCF_RESKEY_server_start_args + +####################################################################### +# Initialization: + +: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat} +. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs + +####################################################################### + +OCF_RESKEY_multi_default="/usr/sbin/rabbitmq-multi" +OCF_RESKEY_ctl_default="/usr/sbin/rabbitmqctl" +OCF_RESKEY_nodename_default="rabbit@localhost" +OCF_RESKEY_log_base_default="/var/log/rabbitmq" +: ${OCF_RESKEY_multi=${OCF_RESKEY_multi_default}} +: ${OCF_RESKEY_ctl=${OCF_RESKEY_ctl_default}} +: ${OCF_RESKEY_nodename=${OCF_RESKEY_nodename_default}} +: ${OCF_RESKEY_log_base=${OCF_RESKEY_log_base_default}} + +meta_data() { + cat < + + +1.0 + + +Resource agent for RabbitMQ-server + + +Resource agent for RabbitMQ-server + + + + +The path to the rabbitmq-multi script + +Path to rabbitmq-multi + + + + + +The path to the rabbitmqctl script + +Path to rabbitmqctl + + + + + +The node name for rabbitmq-server + +Node name + + + + + +The IP address for rabbitmq-server to listen on + +IP Address + + + + + +The IP Port for rabbitmq-server to listen on + +IP Port + + + + + +Location of the cluster config file + +Cluster config file path + + + + + +Location of the config file + +Config file path + + + + + +Location of the directory under which logs will be created + +Log base path + + + + + +Location of the directory under which mnesia will store data + +Mnesia base path + + + + + +Additional arguments provided to the server on startup + +Server start arguments + + + + + + + + + + + + + + +END +} + +rabbit_usage() { + cat < /dev/null 2> /dev/null + rc=$? + case "$rc" in + 0) + ocf_log debug "RabbitMQ server is running normally" + return $OCF_SUCCESS + ;; + 2) + ocf_log debug "RabbitMQ server is not running" + return $OCF_NOT_RUNNING + ;; + *) + ocf_log err "Unexpected return from rabbitmqctl $NODENAME_ARG status: $rc" + exit $OCF_ERR_GENERIC + esac +} + +rabbit_start() { + local rc + + if rabbit_status; then + ocf_log info "Resource already running." + return $OCF_SUCCESS + fi + + export_vars + + $RABBITMQ_MULTI start_all 1 > ${RABBITMQ_LOG_BASE}/startup_log 2> ${RABBITMQ_LOG_BASE}/startup_err & + rc=$? + + if [ "$rc" != 0 ]; then + ocf_log err "rabbitmq-server start command failed: $RABBITMQ_MULTI start_all 1, $rc" + return $rc + fi + + # Spin waiting for the server to come up. + # Let the CRM/LRM time us out if required + start_wait=1 + while [ $start_wait = 1 ]; do + rabbit_status + rc=$? + if [ "$rc" = $OCF_SUCCESS ]; then + start_wait=0 + elif [ "$rc" != $OCF_NOT_RUNNING ]; then + ocf_log info "rabbitmq-server start failed: $rc" + exit $OCF_ERR_GENERIC + fi + sleep 1 + done + + return $OCF_SUCCESS +} + +rabbit_stop() { + local rc + + if ! rabbit_status; then + ocf_log info "Resource not running." + return $OCF_SUCCESS + fi + + $RABBITMQ_MULTI stop_all & + rc=$? + + if [ "$rc" != 0 ]; then + ocf_log err "rabbitmq-server stop command failed: $RABBITMQ_MULTI stop_all, $rc" + return $rc + fi + + # Spin waiting for the server to shut down. + # Let the CRM/LRM time us out if required + stop_wait=1 + while [ $stop_wait = 1 ]; do + rabbit_status + rc=$? + if [ "$rc" = $OCF_NOT_RUNNING ]; then + stop_wait=0 + break + elif [ "$rc" != $OCF_SUCCESS ]; then + ocf_log info "rabbitmq-server stop failed: $rc" + exit $OCF_ERR_GENERIC + fi + sleep 1 + done + + return $OCF_SUCCESS +} + +rabbit_monitor() { + rabbit_status + return $? +} + +case $__OCF_ACTION in + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + rabbit_usage + exit $OCF_SUCCESS + ;; +esac + +if ocf_is_probe; then + rabbit_validate_partial +else + rabbit_validate_full +fi + +case $__OCF_ACTION in + start) + rabbit_start + ;; + stop) + rabbit_stop + ;; + status|monitor) + rabbit_monitor + ;; + validate-all) + exit $OCF_SUCCESS + ;; + *) + rabbit_usage + exit $OCF_ERR_UNIMPLEMENTED + ;; +esac + +exit $? diff --git a/rabbitmq-server.spec b/rabbitmq-server.spec index ee715d7..4db6428 100644 --- a/rabbitmq-server.spec +++ b/rabbitmq-server.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: rabbitmq-server -Version: 1.7.2 +Version: 1.8.0 Release: 1%{?dist} License: MPLv1.1 Group: Development/Libraries @@ -10,9 +10,12 @@ Source1: rabbitmq-server.init Source2: rabbitmq-script-wrapper Source3: rabbitmq-server.logrotate Source4: rabbitmq-asroot-script-wrapper +Source5: rabbitmq-server.ocf +Patch0: bug22871.patch URL: http://www.rabbitmq.com/ -BuildRequires: erlang, python-simplejson -Requires: erlang, logrotate +BuildArch: noarch +BuildRequires: erlang >= R12B-3, python-simplejson, xmlto, libxslt +Requires: erlang >= R12B-3, logrotate BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{_arch}-root Summary: The RabbitMQ server Requires(post): chkconfig initscripts @@ -23,21 +26,23 @@ RabbitMQ is an implementation of AMQP, the emerging standard for high performance enterprise messaging. The RabbitMQ server is a robust and scalable implementation of an AMQP broker. -%define _rabbit_erllibdir %{_libdir}/rabbitmq/lib/rabbitmq_server-%{version} -%define _rabbit_libdir %{_libdir}/rabbitmq +# We want to install into /usr/lib, even on 64-bit platforms +%define _rabbit_libdir %{_exec_prefix}/lib/rabbitmq +%define _rabbit_erllibdir %{_rabbit_libdir}/lib/rabbitmq_server-%{version} %define _rabbit_wrapper %{_builddir}/`basename %{S:2}` %define _rabbit_asroot_wrapper %{_builddir}/`basename %{S:4}` +%define _rabbit_server_ocf %{_builddir}/`basename %{S:5}` %define _maindir %{buildroot}%{_rabbit_erllibdir} %prep %setup -q +%patch0 -p1 %build cp %{S:2} %{_rabbit_wrapper} -sed -i 's|/usr/lib/|%{_libdir}/|' %{_rabbit_wrapper} cp %{S:4} %{_rabbit_asroot_wrapper} -sed -i 's|/usr/lib/|%{_libdir}/|' %{_rabbit_asroot_wrapper} +cp %{S:5} %{_rabbit_server_ocf} make %{?_smp_mflags} %install @@ -57,6 +62,7 @@ install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmq-server install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmq-multi install -p -D -m 0755 %{_rabbit_asroot_wrapper} %{buildroot}%{_sbindir}/rabbitmq-activate-plugins install -p -D -m 0755 %{_rabbit_asroot_wrapper} %{buildroot}%{_sbindir}/rabbitmq-deactivate-plugins +install -p -D -m 0755 %{_rabbit_server_ocf} %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server install -p -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/rabbitmq-server @@ -65,12 +71,12 @@ mkdir -p %{buildroot}%{_sysconfdir}/rabbitmq rm %{_maindir}/LICENSE %{_maindir}/LICENSE-MPL-RabbitMQ %{_maindir}/INSTALL #Build the list of files -rm -f %{_builddir}/filelist.%{name}.rpm -echo '%defattr(-,root,root, -)' >> %{_builddir}/filelist.%{name}.rpm +rm -f %{_builddir}/%{name}.files +echo '%defattr(-,root,root, -)' >> %{_builddir}/%{name}.files (cd %{buildroot}; \ find . -type f ! -regex '\.%{_sysconfdir}.*' \ ! -regex '\.\(%{_rabbit_erllibdir}\|%{_rabbit_libdir}\).*' \ - | sed -e 's/^\.//' >> %{_builddir}/filelist.%{name}.rpm) + | sed -e 's/^\.//' >> %{_builddir}/%{name}.files) %pre @@ -103,7 +109,13 @@ if [ $1 = 0 ]; then # Leave rabbitmq user and group fi -%files -f ../filelist.%{name}.rpm +# Clean out plugin activation state, both on uninstall and upgrade +rm -rf %{_rabbit_erllibdir}/priv +for ext in rel script boot ; do + rm -f %{_rabbit_erllibdir}/ebin/rabbit.$ext +done + +%files -f ../%{name}.files %defattr(-,root,root,-) %attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/lib/rabbitmq %attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/log/rabbitmq @@ -118,6 +130,10 @@ fi rm -rf %{buildroot} %changelog +* Mon Jun 28 2010 Hubert Plociniczak 1.8.0-1 +- New Upstream Release +- Backported fix for bug 22871, fixes issues with erlang >= R14A + * Mon Feb 15 2010 Matthew Sackman 1.7.2-1 - New Upstream Release diff --git a/sources b/sources index e03de64..cc11e8d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fb83be3b1577cdd54459012b85b7631d rabbitmq-server-1.7.2.tar.gz +e00bea375e81d51600b5b14220c64d89 rabbitmq-server-1.8.0.tar.gz