summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Walker <kris240376@gmail.com>2013-05-18 11:02:22 -0300
committerRobby Workman <rworkman@slackbuilds.org>2013-06-04 00:11:08 -0500
commit85c888bd322fd938d4b7e91e09b87bbf11c5f17d (patch)
tree47d4cfb045d28f923ea98d09d8044ed97cc1e2ab
parentf5c5eb7a1792afa66689ca0003b432bf5d42dfbe (diff)
downloadslackbuilds-85c888bd322fd938d4b7e91e09b87bbf11c5f17d.tar.gz
network/jabberd2: Added (XMPP server)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
-rw-r--r--network/jabberd2/README6
-rw-r--r--network/jabberd2/doinst.sh38
-rw-r--r--network/jabberd2/jabberd2.SlackBuild166
-rw-r--r--network/jabberd2/jabberd2.info10
-rw-r--r--network/jabberd2/rc.jabberd239
-rw-r--r--network/jabberd2/slack-desc19
6 files changed, 278 insertions, 0 deletions
diff --git a/network/jabberd2/README b/network/jabberd2/README
new file mode 100644
index 0000000000..20318f1015
--- /dev/null
+++ b/network/jabberd2/README
@@ -0,0 +1,6 @@
+jabberd 2.x project is the next generation of the jabberd project. It
+has been rewritten from the ground up to be scalable, architecturally
+sound and to support the latest protocol extensions coming out of the XSF.
+
+Please note: jabberd 2.x is not a newer version of jabberd 1.x but a
+completely different project.
diff --git a/network/jabberd2/doinst.sh b/network/jabberd2/doinst.sh
new file mode 100644
index 0000000000..6cccf9b3ec
--- /dev/null
+++ b/network/jabberd2/doinst.sh
@@ -0,0 +1,38 @@
+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...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+config etc/jabberd2/c2s.xml.new
+config etc/jabberd2/jabberd-c2s.conf.new
+config etc/jabberd2/jabberd-router.conf.new
+config etc/jabberd2/jabberd-s2s.conf.new
+config etc/jabberd2/jabberd-sm.conf.new
+config etc/jabberd2/jabberd.cfg.new
+config etc/jabberd2/router-filter.xml.new
+config etc/jabberd2/router-users.xml.new
+config etc/jabberd2/router.xml.new
+config etc/jabberd2/s2s.xml.new
+config etc/jabberd2/sm.xml.new
+config etc/jabberd2/templates/roster.xml.new
+
+preserve_perms etc/rc.d/rc.jabberd2.new
diff --git a/network/jabberd2/jabberd2.SlackBuild b/network/jabberd2/jabberd2.SlackBuild
new file mode 100644
index 0000000000..937d4127a3
--- /dev/null
+++ b/network/jabberd2/jabberd2.SlackBuild
@@ -0,0 +1,166 @@
+#!/bin/sh
+
+# Slackware build script for jabberd2
+
+# Copyright 2013 Christopher Walker Copperas Cove, TX
+# 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=jabberd2
+VERSION=${VERSION:-2.2.17}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+JABBERUSR=${JABBERUSR:-jabber}
+JABBERGRP=${JABBERGRP:-jabber}
+JABBERUID=${JABBERUID:-275}
+JABBERGID=${JABBERGID:-275}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+do_exit() {
+ echo ; echo "You must have the ${JABBERUSR} user and ${JABBERGRP} group in"
+ echo "order to build amanda. Sample lines to do so are below:"
+ echo "# groupadd -g ${JABBERGID} ${JABBERGRP}"
+ echo "# useradd -u ${JABBERUID} -g ${JABBERGRP} ${JABBERUSR}"
+ echo "Exiting..." ; echo ; exit 1
+}
+
+# Check for jabber user and group availability
+if ! getent group | grep -q ^${JABBERGRP}: 2>/dev/null ; then
+ do_exit;
+elif ! getent passwd | grep -q ^${JABBERUSR}: 2>/dev/null ; then
+ do_exit;
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf jabberd-$VERSION
+tar xvf $CWD/jabberd-$VERSION.tar.xz
+cd jabberd-$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 {} \;
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc/jabberd2 \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --enable-ldap \
+ --enable-db \
+ --enable-sqlite \
+ --enable-mysql \
+ --enable-ssl \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+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
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/tools
+cp -a \
+ AUTHORS COPYING ChangeLog INSTALL NEWS README README.config README.protocol \
+ README.win32 TODO UPGRADE \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ tools/bdb2mysql.rb tools/bdbdump.pl tools/db-jd14-2-jd2.sql \
+ tools/db-setup.mysql tools/db-setup.oracle tools/db-setup.pgsql \
+ tools/db-setup.sqlite tools/db-update.mysql tools/db-update.pgsql \
+ tools/db-update.sqlite tools/jabberd-authpipe-pam-0.1.pl \
+ tools/jabberd2.schema tools/migrate-jd14dir-2-sqlite.pl \
+ tools/migrate.pl tools/pam_jabberd tools/pipe-auth.pl \
+ $PKG/usr/doc/$PRGNAM-$VERSION/tools
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/etc/rc.d \
+ $PKG/var/lib/jabberd2/{db,fs,stats} \
+ $PKG/var/log/jabberd2 \
+ $PKG/var/run/jabberd2
+chown -R $JABBERUSR.$JABBERGRP $PKG/var/lib/jabberd2 \
+ $PKG/var/log/jabberd2 \
+ $PKG/var/run/jabberd2
+install -o root -g root -m 644 $CWD/rc.jabberd2 $PKG/etc/rc.d/rc.jabberd2.new
+sed -i -e "s/%JABBERUSR%/$JABBERUSR/g" $PKG/etc/rc.d/rc.jabberd2.new
+
+rm -r $PKG/usr/etc \
+ $PKG/etc/jabberd2/*.dist \
+ $PKG/etc/jabberd2/templates/*.dist
+
+find $PKG/etc/jabberd2 -type f -exec mv {} {}.new \;
+find $PKG/etc/jabberd2 -type f -exec chown root.$JABBERGRP {} \; -exec chmod 640 {} \;
+sed -i -e "s#var/jabberd/pid#var/run/jabberd2#g" $PKG/etc/jabberd2/c2s.xml.new
+sed -i -e "s#var/jabberd/log#var/log/jabberd2#g" $PKG/etc/jabberd2/c2s.xml.new
+sed -i -e "s#var/jabberd/stats#var/lib/jabberd2/stats#g" $PKG/etc/jabberd2/c2s.xml.new
+sed -i -e "s#var/jabberd/run#var/run/jabberd2#g" $PKG/etc/jabberd2/c2s.xml.new
+sed -i -e "s#var/jabberd/db#var/lib/jabberd2/db#g" $PKG/etc/jabberd2/c2s.xml.new
+sed -i -e "s#var/jabberd/pid#var/run/jabberd2#g" $PKG/etc/jabberd2/router.xml.new
+sed -i -e "s#var/jabberd/pid#var/run/jabberd2#g" $PKG/etc/jabberd2/s2s.xml.new
+sed -i -e "s#var/jabberd/log#var/log/jabberd2#g" $PKG/etc/jabberd2/s2s.xml.new
+sed -i -e "s#var/jabberd/stats#var/lib/jabberd2/stats#g" $PKG/etc/jabberd2/s2s.xml.new
+sed -i -e "s#var/jabberd/pid#var/run/jabberd2#g" $PKG/etc/jabberd2/sm.xml.new
+sed -i -e "s#var/jabberd/log#var/log/jabberd2#g" $PKG/etc/jabberd2/sm.xml.new
+sed -i -e "s#var/jabberd/db#var/lib/jabberd2/db#g" $PKG/etc/jabberd2/sm.xml.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/network/jabberd2/jabberd2.info b/network/jabberd2/jabberd2.info
new file mode 100644
index 0000000000..8958329f97
--- /dev/null
+++ b/network/jabberd2/jabberd2.info
@@ -0,0 +1,10 @@
+PRGNAM="jabberd2"
+VERSION="2.2.17"
+HOMEPAGE="http://www.jabberd2.org"
+DOWNLOAD="https://github.com/downloads/jabberd2/jabberd2/jabberd-2.2.17.tar.xz"
+MD5SUM="8b7d654deaa6566e58ab6630112f9b10"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="udns libgsasl"
+MAINTAINER="Christopher Walker"
+EMAIL="kris240376@gmail.com"
diff --git a/network/jabberd2/rc.jabberd2 b/network/jabberd2/rc.jabberd2
new file mode 100644
index 0000000000..5319a8eea8
--- /dev/null
+++ b/network/jabberd2/rc.jabberd2
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+jabberd2_start() {
+ su - %JABBERUSR% -c '/usr/bin/jabberd &'
+}
+
+jabberd2_stop() {
+ if [ -e /var/run/jabberd2/router.pid ]; then
+ kill `cat /var/run/jabberd2/router.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/router.pid
+ fi
+ if [ -e /var/run/jabberd2/c2s.pid ]; then
+ kill `cat /var/run/jabberd2/c2s.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/c2s.pid
+ fi
+ if [ -e /var/run/jabberd2/s2s.pid ]; then
+ kill `cat /var/run/jabberd2/s2s.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/s2s.pid
+ fi
+ if [ -e /var/run/jabberd2/sm.pid ]; then
+ kill `cat /var/run/jabberd2/sm.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/sm.pid
+ fi
+}
+
+case "$1" in
+start)
+ jabberd2_start
+ ;;
+stop)
+ jabberd2_stop
+ ;;
+restart)
+ jabberd2_stop
+ sleep 2
+ jabberd2_start
+*)
+ echo "Usage $0 (start|stop|restart|status)"
+esac
diff --git a/network/jabberd2/slack-desc b/network/jabberd2/slack-desc
new file mode 100644
index 0000000000..16e98df0e0
--- /dev/null
+++ b/network/jabberd2/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------------------------------------------------------|
+jabberd2: jabberd2 (XMPP server)
+jabberd2:
+jabberd2: jabberd 2.x project is the next generation of the jabberd project. It
+jabberd2: has been rewritten from the ground up to be scalable,
+jabberd2: architecturally sound and to support the latest protocol extensions
+jabberd2: coming out of the XSF.
+jabberd2:
+jabberd2: Please note: jabberd 2.x is not a newer version of jabberd 1.x but a
+jabberd2: completely different project.
+jabberd2:
+jabberd2: Homepage: http://www.jabberd2.org