diff options
-rw-r--r-- | network/openfire/README | 10 | ||||
-rw-r--r-- | network/openfire/README.Slackware | 24 | ||||
-rw-r--r-- | network/openfire/openfire.SlackBuild | 91 | ||||
-rw-r--r-- | network/openfire/openfire.info | 10 | ||||
-rw-r--r-- | network/openfire/rc.openfire | 95 | ||||
-rw-r--r-- | network/openfire/slack-desc | 19 |
6 files changed, 249 insertions, 0 deletions
diff --git a/network/openfire/README b/network/openfire/README new file mode 100644 index 0000000000..3d1a09f8cc --- /dev/null +++ b/network/openfire/README @@ -0,0 +1,10 @@ +Openfire is a real time collaboration (RTC) server written in Java +and licensed under the Open Source Apache License. +It uses the only widely adopted open protocol for instant messaging, +XMPP (also called Jabber). +Openfire is incredibly easy to setup and administer, but offers +rock-solid security and performance. + +This script repacks the tar.gz into a slackware package. + +See README.Slackware for building and setup details. diff --git a/network/openfire/README.Slackware b/network/openfire/README.Slackware new file mode 100644 index 0000000000..4a997bd6fa --- /dev/null +++ b/network/openfire/README.Slackware @@ -0,0 +1,24 @@ +## Building +This script requires an 'openfire' user/group to exist before +running. +The recommended UID/GID is 265. You can create these like so: + groupadd -g 265 openfire + useradd -u 265 -g 265 -c "Openfire Server" -m openfire + +## Startup +To have this start upon each boot, add the following lines to +/etc/rc.d/rc.local + + # Start openfire + if [ -x /etc/rc.d/rc.openfire ]; then + /etc/rc.d/rc.openfire start + fi + +to stop it at shutdown, add a similar entry substituting +"start" with "stop" in /etc/rc.d/rc.local_shutdown. + +## Setup +For information about setup see: +http://www.howtoforge.com/how-to-set-up-an-openfire-instant-messaging-server-on-centos-5.6 +http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/database.html +http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/install-guide.html diff --git a/network/openfire/openfire.SlackBuild b/network/openfire/openfire.SlackBuild new file mode 100644 index 0000000000..23e0e43517 --- /dev/null +++ b/network/openfire/openfire.SlackBuild @@ -0,0 +1,91 @@ +#!/bin/sh -e +# +# Slackware build script for Zeromq-jzmq +# Written by Mário Antunes (mario.antunes@av.it.pt) +# Modified by the slackbuilds.org project + +PRGNAM=openfire +VERSION=${VERSION:-3_7_1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +ARCH=noarch + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +# select openfire default user/group +OPENFIRE_USER=${OPENFIRE_USER:-openfire} +OPENFIRE_UID=${OPENFIRE_UID:-265} +OPENFIRE_GROUP=${OPENFIRE_GROUP:-openfire} +OPENFIRE_GID=${OPENFIRE_GID:-265} + +# Installation path +PREFIX=/opt/openfire + +bailout() { + echo " You must have a $OPENFIRE_USER user and $OPENFIRE_GROUP group to run this script. " + echo " Something like this should suffice for most systems: " + echo " # groupadd -g $OPENFIRE_GID $OPENFIRE_GROUP " + echo " # useradd -u $OPENFIRE_UID -g $OPENFIRE_GID -c \"Openfire Server\" -m $OPENFIRE_USER " + exit 1 +} + +# Bail if user and/or group isn't valid on your system +# uid=265 is suggested to avoid conflicts with other SBo packages, +# but it's your call: http://slackbuilds.org/uid_gid.txt +if ! grep -q "^$OPENFIRE_USER:" /etc/passwd; then + bailout +elif ! grep -q "^$OPENFIRE_GROUP:" /etc/group; then + bailout +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP + +rm -rf $PRGNAM +tar xvf $CWD/$PRGNAM\_$VERSION.tar.gz +cd $PRGNAM +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 {} \; + +mkdir -p $PKG$PREFIX/ +cp -a bin/ $PKG$PREFIX/ +cp -a .install4j/ $PKG$PREFIX/ +cp -a conf/ $PKG$PREFIX/ +cp -a lib/ $PKG$PREFIX/ +mkdir -p $PKG$PREFIX/logs +cp -a plugins/ $PKG$PREFIX/ +cp -a resources/ $PKG$PREFIX/ + +mkdir -p $PKG/var/log/$PRGNAM +chown -R $OPENFIRE_USER:$OPENFIRE_GROUP $PKG$PREFIX $PKG/var/log/$PRGNAM + +mkdir -p $PKG/etc/rc.d +sed \ + -e "s|@OPENFIRE_USER@|$OPENFIRE_USER|" \ + -e "s|@PREFIX@|$PREFIX|" \ + $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM +chmod 755 $PKG/etc/rc.d/rc.$PRGNAM + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \ + grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a *.html documentation/ $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/openfire/openfire.info b/network/openfire/openfire.info new file mode 100644 index 0000000000..06d9ee99cc --- /dev/null +++ b/network/openfire/openfire.info @@ -0,0 +1,10 @@ +PRGNAM="openfire" +VERSION="3.7.1" +HOMEPAGE="http://www.igniterealtime.org/projects/openfire/" +DOWNLOAD="http://download.igniterealtime.org/openfire/openfire_3_7_1.tar.gz" +MD5SUM="ccc26d9ab01e0b08b67e419a8c028395" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="jdk" +MAINTAINER="Mário Antunes" +EMAIL="mariolpantunes@gmail.com" diff --git a/network/openfire/rc.openfire b/network/openfire/rc.openfire new file mode 100644 index 0000000000..ebe930c65a --- /dev/null +++ b/network/openfire/rc.openfire @@ -0,0 +1,95 @@ +#!/bin/sh +# rc.openfire +# Initscript that manages an instance of openfire running on Slackware Linux. +# Assembled by Matteo Bernardini <ponce@slackbuilds.org> + +OPENFIRE_USER="openfire" +OPENFIRE_HOME="/opt/openfire" +OPENFIRE_PIDFILE="/var/run/openfire.pid" + +JAVACMD="$JAVA_HOME/bin/java" + +if [ ! -d "$JAVA_HOME" -o ! -x "$JAVACMD" ]; then + echo "Error: JAVA_HOME is not defined correctly." + echo " Can not sure execute $JAVACMD." + exit 1 +fi + +# Set logs location +OPENFIRE_LOGDIR="/var/log/openfire" + +# Prepare location of openfire libraries +OPENFIRE_LIB="$OPENFIRE_HOME/lib" + +# Prepare openfire command line +OPENFIRE_OPTS="-DopenfireHome=$OPENFIRE_HOME -Dopenfire.lib.dir=$OPENFIRE_LIB" + +# Prepare local java class path +if [ -z "$LOCALCLASSPATH" ]; then + LOCALCLASSPATH="$OPENFIRE_LIB/startup.jar" +else + LOCALCLASSPATH="$OPENFIRE_LIB/startup.jar:$LOCALCLASSPATH" +fi + +# Export any necessary variables +export JAVA_HOME JAVACMD + +# Lastly, prepare the full command that we are going to run. +OPENFIRE_RUN_CMD="$JAVACMD -server $OPENFIRE_OPTS -classpath \"$LOCALCLASSPATH\" -jar \"$OPENFIRE_LIB/startup.jar\"" + +openfire_start() { + echo "Starting Openfire..." + [ -f "$OPENFIRE_PIDFILE" ] && echo "openfire is already running. If it's not, remove $OPENFIRE_PIDFILE and retry." && exit 1 + # Launch openfire + su - $OPENFIRE_USER -c "cd $OPENFIRE_LOGDIR ; nohup $OPENFIRE_RUN_CMD > $OPENFIRE_LOGDIR/nohup.out 2>&1 &" + sleep 3 + # Store the pid + ps ax | grep 'java\ \-server' | awk '{print $1}' > $OPENFIRE_PIDFILE + echo "Running." +} + +openfire_stop() { + echo "Stopping Openfire..." + [ -f "$OPENFIRE_PIDFILE" ] && kill $(cat $OPENFIRE_PIDFILE) + RETVAL=$? + [ $RETVAL -eq 0 -a -f "$OPENFIRE_PIDFILE" ] && rm -f $OPENFIRE_PIDFILE + echo "Stopped." +} + +openfire_status() { + PID=$(cat $OPENFIRE_PIDFILE 2>&1) + if [ "$?" = "1" ]; then + echo "openfire is not running" + RETVAL=3 + else + ps -p $PID > /dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "openfire is running" + RETVAL=0 + else + echo "openfire is not running" + RETVAL=1 + fi + fi +} + +case "$1" in + start) + openfire_start + ;; + stop) + openfire_stop + ;; + restart) + openfire_stop + sleep 10 + openfire_start + ;; + status) + openfire_status + ;; + *) + echo "Usage $0 (start|stop|restart|status)" +esac + +exit 0 diff --git a/network/openfire/slack-desc b/network/openfire/slack-desc new file mode 100644 index 0000000000..db6fee02ba --- /dev/null +++ b/network/openfire/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 ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +openfire: openfire (XMPP server) +openfire: +openfire: Openfire is a real time collaboration (RTC) server written in Java +openfire: and licensed under the Open Source Apache License. +openfire: It uses the only widely adopted open protocol for instant messaging, +openfire: XMPP (also called Jabber). +openfire: Openfire is incredibly easy to setup and administer, but offers +openfire: rock-solid security and performance. +openfire: +openfire: homepage: http://www.igniterealtime.org/projects/openfire/ +openfire: |