[Lunar-commits] <moonbase> rabbitmq-server: Initial import of this enterprise message bus based on erlang

Stefan Wold ratler at lunar-linux.org
Sun Sep 19 19:27:39 CEST 2010


commit 7ebeeb2b29933b2482ec97a33a72d0d4390e627e
Author: Stefan Wold <ratler at lunar-linux.org>
Date:   Sun Sep 19 19:27:39 2010 +0200

    rabbitmq-server: Initial import of this enterprise message bus based on erlang
---
 net/rabbitmq-server/BUILD                       |   15 ++++++
 net/rabbitmq-server/DEPENDS                     |    5 ++
 net/rabbitmq-server/DETAILS                     |   19 +++++++
 net/rabbitmq-server/init.d/rabbitmq-server      |   60 +++++++++++++++++++++++
 net/rabbitmq-server/logrotate.d/rabbitmq-server |   12 +++++
 5 files changed, 111 insertions(+), 0 deletions(-)

diff --git a/net/rabbitmq-server/BUILD b/net/rabbitmq-server/BUILD
new file mode 100644
index 0000000..8379bd0
--- /dev/null
+++ b/net/rabbitmq-server/BUILD
@@ -0,0 +1,15 @@
+(
+  add_priv_user rabbitmq:rabbitmq -d /var/lib/rabbitmq &&
+  make &&
+  prepare_install &&
+  make install TARGET_DIR=/usr/lib/rabbitmq/lib/rabbitmq_server-${VERSION} \
+               SBIN_DIR=/usr/lib/rabbitmq/bin \
+               MAN_DIR=/usr/share/man &&
+
+  install -p -D -m 0755 $SOURCE_CACHE/$SOURCE2 /usr/sbin/rabbitmqctl &&
+  install -p -D -m 0755 $SOURCE_CACHE/$SOURCE2 /usr/sbin/rabbitmq-server &&
+  install -p -D -m 0755 $SOURCE_CACHE/$SOURCE2 /usr/sbin/rabbitmq-multi &&
+  install -o rabbitmq -g rabbitmq -m 750 -d /var/log/rabbitmq &&
+  install -o rabbitmq -g rabbitmq -m 750 -d /var/lib/rabbitmq
+
+) > $C_FIFO 2>&1
diff --git a/net/rabbitmq-server/DEPENDS b/net/rabbitmq-server/DEPENDS
new file mode 100644
index 0000000..f2b3f87
--- /dev/null
+++ b/net/rabbitmq-server/DEPENDS
@@ -0,0 +1,5 @@
+depends erlang
+depends Python
+depends xmlto
+depends libxslt
+depends logrotate
diff --git a/net/rabbitmq-server/DETAILS b/net/rabbitmq-server/DETAILS
new file mode 100644
index 0000000..013c721
--- /dev/null
+++ b/net/rabbitmq-server/DETAILS
@@ -0,0 +1,19 @@
+          MODULE=rabbitmq-server
+         VERSION=2.1.0
+          SOURCE=${MODULE}-${VERSION}.tar.gz
+         SOURCE2=rabbitmq-script-wrapper-0.1
+      SOURCE_URL=http://www.rabbitmq.com/releases/rabbitmq-server/v${VERSION}
+     SOURCE2_URL=$PATCH_URL
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/$MODULE-$VERSION
+      SOURCE_VFY=sha256:16e3fa66ba36ee1478f79d83bc24f86be04123ba814f89d11fb6d1850267cd78
+     SOURCE2_VFY=sha256:ec31350a636347cef2e3aab097c6b483f20ca3b03cf2c21d08f1179a156cefe5
+        WEB_SITE="http://www.rabbitmq.com/"
+      MAINTAINER=ratler at lunar-linux.org
+         ENTERED=20100919
+         UPDATED=20100919
+           SHORT="AMQP, the emerging standard for high performance enterprise messaging"
+cat <<EOF
+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.
+EOF
diff --git a/net/rabbitmq-server/init.d/rabbitmq-server b/net/rabbitmq-server/init.d/rabbitmq-server
new file mode 100755
index 0000000..1096541
--- /dev/null
+++ b/net/rabbitmq-server/init.d/rabbitmq-server
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# rabbitmq-server RabbitMQ broker
+#
+# chkconfig: - 80 05
+# description: Enable AMQP service provided by RabbitMQ
+# processname: rabbitmq-multi
+
+DAEMON=/usr/sbin/rabbitmq-multi
+INIT_LOG_DIR=/var/log/rabbitmq
+NODE_COUNT=1
+
+start() {
+  echo -n "Starting rabbitmq-server: "
+  $DAEMON start_all ${NODE_COUNT} > ${INIT_LOG_DIR}/startup_log 2> ${INIT_LOG_DIR}/startup_err &&
+  echo -e "$RESULT_OK" || echo -e "$RESULT_FAIL"
+}
+
+stop() {
+  status_rabbitmq quiet
+  if [ $? = 0 ]; then
+    echo -n "Stopping rabbitmq-server: "
+    $DAEMON stop_all > ${INIT_LOG_DIR}/shutdown_log 2> ${INIT_LOG_DIR}/shutdown_err &&
+    echo -e "$RESULT_OK" || echo -e "$RESULT_FAIL"
+  else
+    echo "No nodes running"
+    exit 0
+  fi
+}
+
+status_rabbitmq() {
+    if [ "$1" != "quiet" ] ; then
+        $DAEMON status 2>&1
+    else
+        $DAEMON status > /dev/null 2>&1
+    fi
+}
+
+status() {
+  status_rabbitmq
+}
+
+rotate_logs() {
+  echo -n "Rotating rabbitmq-server logs: "
+  $DAEMON rotate_logs &> /dev/null &&
+  echo -e "$RESULT_OK" || echo -e "$RESULT_FAIL"
+}
+
+restart() {
+  $0 stop
+  sleep 1
+  $0 start
+}
+
+case "$1" in
+  start|stop|restart|rotate_logs|status) ;;
+  *) echo "Usage: $0 {start|stop|restart|rotate_logs|status}" ; exit 1;;
+esac
+
+. /lib/lsb/init-functions
diff --git a/net/rabbitmq-server/logrotate.d/rabbitmq-server b/net/rabbitmq-server/logrotate.d/rabbitmq-server
new file mode 100644
index 0000000..679764b
--- /dev/null
+++ b/net/rabbitmq-server/logrotate.d/rabbitmq-server
@@ -0,0 +1,12 @@
+/var/log/rabbitmq/*.log {
+        weekly
+        missingok
+        rotate 20
+        compress
+        delaycompress
+        notifempty
+        sharedscripts
+        postrotate
+            /sbin/service rabbitmq-server rotate_logs > /dev/null
+        endscript
+}


More information about the Lunar-commits mailing list