diff options
author | Marco Bonetti <sid77@slackware.it> | 2011-10-21 11:23:23 -0500 |
---|---|---|
committer | Niels Horn <niels.horn@slackbuilds.org> | 2011-10-22 10:17:10 -0200 |
commit | 50562f88dff2535a1f84fc03c23a3f5c137871c5 (patch) | |
tree | 77cab459b8bf1be87633acbcde9ff9743340493e /system | |
parent | ae10052ebd5eee1f2dd95f7353d9327334eb5084 (diff) |
system/apache-activemq: Added (Apache ActiveMQ)
Signed-off-by: Erik Hanson <erik@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/apache-activemq/README | 18 | ||||
-rw-r--r-- | system/apache-activemq/apache-activemq.SlackBuild | 126 | ||||
-rw-r--r-- | system/apache-activemq/apache-activemq.info | 10 | ||||
-rw-r--r-- | system/apache-activemq/default.activemq | 82 | ||||
-rw-r--r-- | system/apache-activemq/doinst.sh | 25 | ||||
-rw-r--r-- | system/apache-activemq/rc.activemq | 21 | ||||
-rw-r--r-- | system/apache-activemq/slack-desc | 19 |
7 files changed, 301 insertions, 0 deletions
diff --git a/system/apache-activemq/README b/system/apache-activemq/README new file mode 100644 index 000000000000..405ea261764d --- /dev/null +++ b/system/apache-activemq/README @@ -0,0 +1,18 @@ +Apache ActiveMQ is the most popular and powerful open source messaging and +Integration Patterns provider. + +Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, +comes with easy to use Enterprise Integration Patterns and many advanced +features while fully supporting JMS 1.1 and J2EE 1.4. Apache ActiveMQ is +released under the Apache 2.0 License. + +This package provides an /etc/rc.d/rc.activemq init script to manage the main +ActiveMQ system instance. If you want to run different instances on the same +machine: +1) create the configuration file /etc/default/activemq-instance-<INSTANCENAME> +2) create an appropriate ACTIVEMQ_HOME +3) ln -sf /usr/share/activemq/bin/activemq /usr/local/bin/activemq-instance-<INSTANCENAME> +4) use /usr/local/bin/activemq-instance-<INSTANCENAME> to start/stop/restart +your own instance. + +This package requires either jre or jdk. diff --git a/system/apache-activemq/apache-activemq.SlackBuild b/system/apache-activemq/apache-activemq.SlackBuild new file mode 100644 index 000000000000..c47bb31ea8ef --- /dev/null +++ b/system/apache-activemq/apache-activemq.SlackBuild @@ -0,0 +1,126 @@ +#!/bin/sh + +# Slackware build script for Apache Active MQ. + +# Copyright 2011-2012 Marco Bonetti <sid77@slackware.it> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=apache-activemq +VERSION=${VERSION:-5.5.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +ACTIVEMQ_USER=${ACTIVEMQ_USER:-activemq} +ACTIVEMQ_UID=${ACTIVEMQ_UID:-253} +ACTIVEMQ_GROUP=${ACTIVEMQ_GROUP:-activemq} +ACTIVEMQ_GID=${ACTIVEMQ_GID:-253} + +# i486 or x86_64 only +ARCH=${ARCH:-i486} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +ACTIVEMQ_HOME=/usr/share/activemq + +DOCS="LICENSE NOTICE README.txt WebConsole-README.txt docs user-guide.html example" + +bailout() { + echo " You must have a $ACTIVEMQ_USER user and $ACTIVEMQ_GROUP group to run this script. " + echo " Something like this should suffice for most systems: " + echo " # groupadd -g $ACTIVEMQ_GID $ACTIVEMQ_GROUP " + echo " # useradd -u $ACTIVEMQ_UID -g $ACTIVEMQ_GID -c \"Apache Active MQ\" -d /var/lib/activemq -s /bin/sh $ACTIVEMQ_USER " + echo " Giving /bin/sh as $ACTIVEMQ_USER shell is important as the init script will try tu 'su -' to it." + exit 1 +} + +# Bail if user and/or group isn't valid on your system +# uid=250 is suggested to avoid conflicts with other SBo packages, +# but it's your call: http://slackbuilds.org/uid_gid.txt +if ! grep -q "^$ACTIVEMQ_USER:" /etc/passwd; then + bailout +elif ! grep -q "^$ACTIVEMQ_GROUP:" /etc/group; then + bailout +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION-bin.tar.gz +cd $PRGNAM-$VERSION + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Worst file permissions ever seen in a package... +find . -type d -exec chmod 755 {} \; +find . -type f -not -path './bin/*' -exec chmod 644 {} \; +chmod 644 ./bin/wrapper.jar + +mkdir -p $PKG/etc/activemq \ + $PKG/usr/share/activemq/data \ + $PKG/var/{run,lib,log}/activemq + +cp -f conf/* $PKG/etc/activemq/ +rm -rf bin/macosx +cp -rf bin lib $PKG/usr/share/activemq/ +cp -rf webapps $PKG/var/lib/activemq/ + +chown -R $ACTIVEMQ_USER:$ACTIVEMQ_GROUP $PKG/usr/share/activemq/data +chown -R $ACTIVEMQ_USER:$ACTIVEMQ_GROUP $PKG/var/{run,lib,log}/activemq + +# LOTS of stuff, some of them are just sample config files though. +# First I fix log4j properties, then I rename the files. +( cd $PKG/etc/activemq + sed -i -e 's:data/activemq.log:log/activemq.log:g' * + sed -i -e 's:data/audit.log:log/audit.log:g' * + for F in `find . -type f`; do mv $F $F.new; done +) + +# These links are still needed for activemq to actually work +ln -sf /etc/activemq $PKG/usr/share/activemq/conf +ln -sf /var/lib/activemq/webapps $PKG/usr/share/activemq/webapps +ln -sf /var/log/activemq $PKG/usr/share/activemq/log + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/etc/default +cat $CWD/default.activemq > $PKG/etc/default/activemq.new + +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.activemq > $PKG/etc/rc.d/rc.activemq.new + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/apache-activemq/apache-activemq.info b/system/apache-activemq/apache-activemq.info new file mode 100644 index 000000000000..f4f150f5425e --- /dev/null +++ b/system/apache-activemq/apache-activemq.info @@ -0,0 +1,10 @@ +PRGNAM="apache-activemq" +VERSION="5.5.1" +HOMEPAGE="http://activemq.apache.org/" +DOWNLOAD="http://www.apache.org/dist/activemq/apache-activemq/5.5.1/apache-activemq-5.5.1-bin.tar.gz" +MD5SUM="3e10c163c5e3869a9720d47849a5ae29" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Marco Bonetti" +EMAIL="sid77@slackware.it" +APPROVED="Erik Hanson" diff --git a/system/apache-activemq/default.activemq b/system/apache-activemq/default.activemq new file mode 100644 index 000000000000..7a3bbf23420a --- /dev/null +++ b/system/apache-activemq/default.activemq @@ -0,0 +1,82 @@ +# Active MQ installation dir +ACTIVEMQ_HOME="/usr/share/activemq" +ACTIVEMQ_BASE="$ACTIVEMQ_HOME" + +# Active MQ configuration directory +ACTIVEMQ_CONFIG_DIR="/etc/activemq" + +# Active MQ data directory +ACTIVEMQ_DATA_DIR="$ACTIVEMQ_BASE/data" + +# Location of the pidfile +ACTIVEMQ_PIDFILE="/var/run/activemq/activemq.pid" + +# Location of the java installation +# Specify the location of your java installation using JAVA_HOME, or specify the +# path to the "java" binary using JAVACMD +# (set JAVACMD to "auto" for automatic detection) +#JAVA_HOME="" +JAVACMD="auto" + +# Configure a user with non root priviledges, if no user is specified do not change user +ACTIVEMQ_USER="activemq" + +# Set jvm memory configuration +ACTIVEMQ_OPTS_MEMORY="-Xms256M -Xmx256M" +ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties" + +# Uncomment to enable audit logging +#ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS -Dorg.apache.activemq.audit=true" + +# Set jvm jmx configuration +# This enables jmx access over a configured jmx-tcp-port. +# You have to configure the first four settings if you run a ibm jvm, caused by the +# fact that IBM's jvm does not support VirtualMachine.attach(PID). +# JMX access is needed for quering a running activemq instance to gain data or to +# trigger management operations. +# +# Example for ${ACTIVEMQ_CONFIG_DIR}/jmx.access: +# --- +# # The "monitorRole" role has readonly access. +# # The "controlRole" role has readwrite access. +# monitorRole readonly +# controlRole readwrite +# --- +# +# Example for ${ACTIVEMQ_CONFIG_DIR}/jmx.password: +# --- +# # The "monitorRole" role has password "abc123". +# # # The "controlRole" role has password "abcd1234". +# monitorRole abc123 +# controlRole abcd1234 +# --- +# +# ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=11099 " +# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONFIG_DIR}/jmx.password" +# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONFIG_DIR}/jmx.access" +# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false" +ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote" + +# Set jvm jmx configuration for controlling the broker process +# You only have to configure the first four settings if you run a ibm jvm, caused by the +# fact that IBM's jvm does not support VirtualMachine.attach(PID) +# (see also com.sun.management.jmxremote.port, .jmx.password.file and .jmx.access.file ) +#ACTIVEMQ_SUNJMX_CONTROL="--jmxurl service:jmx:rmi:///jndi/rmi://127.0.0.1:11099/jmxrmi --jmxuser controlRole --jmxpassword abcd1234" +ACTIVEMQ_SUNJMX_CONTROL="" + +# Specify the queue manager URL for using "browse" option of sysv initscript +ACTIVEMQ_QUEUEMANAGERURL="--amqurl tcp://localhost:61616" + +# Set additional JSE arguments +ACTIVEMQ_SSL_OPTS="$SSL_OPTS" + +# Uncomment to enable YourKit profiling +#ACTIVEMQ_DEBUG_OPTS="-agentlib:yjpagent" + +# Uncomment to enable remote debugging +#ACTIVEMQ_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" + +# ActiveMQ tries to shutdown the broker by jmx, +# after a specified number of seconds send SIGKILL +ACTIVEMQ_KILL_MAXSECONDS=30 + diff --git a/system/apache-activemq/doinst.sh b/system/apache-activemq/doinst.sh new file mode 100644 index 000000000000..5a15a4d2018e --- /dev/null +++ b/system/apache-activemq/doinst.sh @@ -0,0 +1,25 @@ +config() { + NEW="$1" + OLD="`dirname $NEW`/`basename $NEW .new`" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.activemq.new: +if [ -e etc/rc.d/rc.activemq ]; then + cp -a etc/rc.d/rc.activemq etc/rc.d/rc.activemq.new.incoming + cat etc/rc.d/rc.activemq.new > etc/rc.d/rc.activemq.new.incoming + mv etc/rc.d/rc.activemq.new.incoming etc/rc.d/rc.activemq.new +fi + +config etc/default/activemq.new +config etc/rc.d/rc.activemq.new +for F in `find etc/activemq -name '*.new'`; do + config $F +done + diff --git a/system/apache-activemq/rc.activemq b/system/apache-activemq/rc.activemq new file mode 100644 index 000000000000..0f225dc2d6c4 --- /dev/null +++ b/system/apache-activemq/rc.activemq @@ -0,0 +1,21 @@ +#!/bin/sh +# Start/stop/restart Apache ActiveMQ daemon + +DAEMON="/usr/share/activemq/bin/activemq" + +case "$1" in +'start') + ${DAEMON} start + ;; +'stop') + ${DAEMON} stop + ;; +'restart') + ${DAEMON} stop + sleep 1 + ${DAEMON} start + ;; +*) + echo "usage $0 start|stop|restart" +esac + diff --git a/system/apache-activemq/slack-desc b/system/apache-activemq/slack-desc new file mode 100644 index 000000000000..56618ecc7a63 --- /dev/null +++ b/system/apache-activemq/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +apache-activemq: apache-activemq (Apache ActiveMQ) +apache-activemq: +apache-activemq: Apache ActiveMQ is the most popular and powerful open source messaging +apache-activemq: and Integration Patterns provider. +apache-activemq: +apache-activemq: +apache-activemq: +apache-activemq: +apache-activemq: +apache-activemq: +apache-activemq: |