0

Initial commit

This commit is contained in:
eleksir
2023-11-19 18:01:40 +03:00
commit 80ec8a7529
586 changed files with 29486 additions and 0 deletions

19
openfire/README Normal file
View File

@@ -0,0 +1,19 @@
Openfire is a real time collaboration (RTC) server 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.
Groupname and Username
You must have the 'openfire' group and user to run this script,
for example:
groupadd -g 265 openfire
useradd -u 265 -g 265 -c "Openfire Server" -m openfire
See README.SLACKWARE for more setup details.

25
openfire/README.SLACKWARE Normal file
View File

@@ -0,0 +1,25 @@
## 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
You will also want to put the following into /etc/rc.d/rc.local_shutdown
(if that file does not exist, create it and make it executable):
# Stop openfire
if [ -x /etc/rc.d/rc.openfire ]; then
/etc/rc.d/rc.openfire stop
fi
## 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

115
openfire/openfire.SlackBuild Executable file
View File

@@ -0,0 +1,115 @@
#!/bin/bash
#
# Slackware build script for openfire
# Written by Mário Antunes (mariolpantunes@gmail.com)
# Updated by Sergei Fedosoff <eleksir@gmail.com>
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=openfire
VERSION=${VERSION:-4.7.5}
BUILD=${BUILD:-1}
TAG=${TAG:-_EXs}
PKGTYPE=${PKGTYPE:-tgz}
SRCVER=$(echo $VERSION | tr . _)
ARCH=noarch
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/EXs}
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}
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 ! getent passwd $OPENFIRE_USER 2>/dev/null; then
bailout
elif ! getent group $OPENFIRE_GROUP 2>/dev/null; then
bailout
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
tar xvf $CWD/$PRGNAM\_$SRCVER.tar.gz
cd $PRGNAM
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Installation path
PREFIX=/opt/$PRGNAM
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/profile.d
cat << EOF > $PKG/etc/profile.d/$PRGNAM.sh
#!/bin/sh
export openfireHome=/opt/openfire
EOF
cat << EOF > $PKG/etc/profile.d/$PRGNAM.csh
#!/bin/csh
setenv openfireHome /opt/openfire
EOF
chmod 755 $PKG/etc/profile.d/*
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
cat $CWD/slack-required > $PKG/install/slack-required
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE

10
openfire/openfire.info Normal file
View File

@@ -0,0 +1,10 @@
PRGNAM="openfire"
VERSION="4.7.5"
HOMEPAGE="http://www.igniterealtime.org/projects/openfire/"
DOWNLOAD="https://github.com/igniterealtime/Openfire/releases/download/v4.7.5/openfire_4_7_5.tar.gz"
MD5SUM="bed735f70dbea959d8659f00d975ca6d"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="openjdk8"
MAINTAINER="Sergei Fedosoff"
EMAIL="eleksir@gmail.com"

95
openfire/rc.openfire Normal file
View File

@@ -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="/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

19
openfire/slack-desc Normal file
View File

@@ -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 licensed under the
openfire: Open Source Apache License. It uses the only widely adopted open
openfire: protocol for instant messaging, XMPP (also called Jabber). Openfire
openfire: is incredibly easy to setup and administer, but offers rock-solid
openfire: security and performance.
openfire:
openfire:
openfire:
openfire:

1
openfire/slack-required Normal file
View File

@@ -0,0 +1 @@
openjdk8