From 995510e0b97e7b0d4fdac6e6e917cf8334006aeb Mon Sep 17 00:00:00 2001 From: Chris Walker Date: Fri, 21 Sep 2018 22:26:38 +0100 Subject: office/SOGo: Added (open source groupware). Signed-off-by: David Spencer --- office/SOGo/README | 22 ++++++ office/SOGo/README.SBo | 13 ++++ office/SOGo/SOGo.SlackBuild | 166 ++++++++++++++++++++++++++++++++++++++++++++ office/SOGo/SOGo.info | 10 +++ office/SOGo/doinst.sh | 31 +++++++++ office/SOGo/rc.sogo | 70 +++++++++++++++++++ office/SOGo/slack-desc | 19 +++++ 7 files changed, 331 insertions(+) create mode 100644 office/SOGo/README create mode 100644 office/SOGo/README.SBo create mode 100644 office/SOGo/SOGo.SlackBuild create mode 100644 office/SOGo/SOGo.info create mode 100644 office/SOGo/doinst.sh create mode 100644 office/SOGo/rc.sogo create mode 100644 office/SOGo/slack-desc (limited to 'office') diff --git a/office/SOGo/README b/office/SOGo/README new file mode 100644 index 0000000000..03cf0106a1 --- /dev/null +++ b/office/SOGo/README @@ -0,0 +1,22 @@ +SOGo is a fully supported and trusted groupware server with a focus on +scalability and open standards. SOGo is released under the GNU +GPL/LGPL v2 and above. + +SOGo provides a rich AJAX-based Web interface and supports multiple +native clients through the use of standard protocols such as CalDAV, +CardDAV and GroupDAV, as well as Microsoft ActiveSync. + +SOGo is the missing component of your infrastructure; it sits in the +middle of your servers to offer your users a uniform and complete +interface to access their information. It has been deployed in +production environments where thousands of users are involved. + +Groupname and Username + +You must have the 'sogo' group and user to run this script, +for example: + + groupadd -g 356 sogo + useradd -u 356 -m -d /var/lib/sogo -s /bin/bash -g 356 sogo + +For some basic setup instructions, check the included 'README.SBo'. diff --git a/office/SOGo/README.SBo b/office/SOGo/README.SBo new file mode 100644 index 0000000000..a8e1180253 --- /dev/null +++ b/office/SOGo/README.SBo @@ -0,0 +1,13 @@ +To start SOGo automatically at system startup, add the following to +your /etc/rc.d/rc.local: + + if [ -x /etc/rc.d/rc.sogo ]; then + /etc/rc.d/rc.sogo start + fi + +To stop sogo automatically at system shutdown, add the following to +your /etc/rc.d/rc.local_shutdown: + + if [ -x /etc/rc.d/rc.sogo ]; then + /etc/rc.d/rc.sogo stop + fi diff --git a/office/SOGo/SOGo.SlackBuild b/office/SOGo/SOGo.SlackBuild new file mode 100644 index 0000000000..6336472f63 --- /dev/null +++ b/office/SOGo/SOGo.SlackBuild @@ -0,0 +1,166 @@ +#!/bin/sh + +# Slackware build script for SOGo + +# Copyright 2018 Chris Walker Kempner, 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=SOGo +VERSION=${VERSION:-4.0.2} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -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 + +PRGUID=356 +PRGGID=356 +PRGUSR=${PRGUSR:-sogo} +PRGGRP=${PRGGRP:-sogo} + +if [ -z "$(getent passwd $PRGUSR)" -o -z "$(getent group $PRGGRP)" ]; then + echo + echo "You must have the $PRGUSR user and $PRGGRP group in order to build $PRGNAM." + echo + echo "Example:" + echo " # groupadd -g $PRGGID $PRGGRP" + echo " # useradd -u $PRGUID -m -d /var/lib/$PRGUSR -s /bin/bash -g $PRGGRP $PRGUSR" + echo + exit 1 +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +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 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --enable-strip + +make +make install DESTDIR=$PKG GNUSTEP_INSTALLATION_DOMAIN=SYSTEM + +# The symbolic links created to libSOGo.so are broken; remove them and create +# symbolic links that work +( cd $PKG/usr/lib${LIBDIRSUFFIX}/sogo + ln -sf ../../lib/GNUstep/Frameworks/SOGo.framework/Versions/Current/sogo/libSOGo.so libSOGo.so + ln -sf ../../lib/GNUstep/Frameworks/SOGo.framework/Versions/Current/sogo/libSOGo.so.4 libSOGo.so.4 + ln -sf ../../lib/GNUstep/Frameworks/SOGo.framework/Versions/Current/sogo/libSOGo.so.4.0.2 libSOGo.so.4.0.2 +) + +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/var/log/sogo $PKG/var/spool/sogo $PKG/var/run/sogo +chown $PRGUSR:$PRGGRP $PKG/var/log/sogo $PKG/var/spool/sogo $PKG/var/run/sogo + +# Install daemon script +mkdir -p $PKG/etc/rc.d +sed -e "s,USER=sogo,USER=$PRGUSR,g" $CWD/rc.sogo > $PKG/etc/rc.d/rc.sogo.new + +# Install crontab files +mkdir -p $PKG/etc/cron.d +sed -e "s,\s\+sogo\s\+/usr/sbin, /usr/sbin,g" \ + -e "s,\s\+sogo\s\+/usr/share/doc/sogo, /usr/doc/$PRGNAM-$VERSION,g" \ + Scripts/sogo.cron > $PKG/etc/cron.d/sogo.new + +mkdir -p $PKG/etc/cron.daily +cat Scripts/tmpwatch > $PKG/etc/cron.daily/sogo.new +chmod +x $PKG/etc/cron.daily/sogo.new + +# Install logrotate config +mkdir -p $PKG/etc/logrotate.d +cat Scripts/logrotate > $PKG/etc/logrotate.d/sogo.new + +# Install configuration files +mkdir -p $PKG/etc/{sogo,sysconfig} +cat Scripts/sogo.conf > $PKG/etc/sogo/sogo.conf.new +sed -e "s,USER=sogo,USER=$PRGUSR,g" Scripts/sogo-default > $PKG/etc/sysconfig/sogo.new + +# Install example SOGo Apache configuration files +mkdir -p $PKG/etc/httpd/extra +cat Apache/SOGo.conf > $PKG/etc/httpd/extra/httpd-sogo.conf.new + +# Install documentation +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + COPYING.GPL COPYING.LGPL ChangeLog ChangeLog.old NEWS README.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +# Install backup script +cat Scripts/sogo-backup.sh > $PKG/usr/doc/$PRGNAM-$VERSION/sogo-backup.sh +chmod +x $PKG/usr/doc/$PRGNAM-$VERSION/sogo-backup.sh + +# Install fail2ban configuration files +cp -r Scripts/fail2ban $PKG/usr/doc/$PRGNAM-$VERSION + +# Install Thunderbird extension propagation script +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/Thunderbird +cat Scripts/updates.php > $PKG/usr/doc/$PRGNAM-$VERSION/Thunderbird/updates.php + +# Install database scripts +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/db +cp -a \ + Scripts/mysql-utf8mb4.sql Scripts/sql-update-*.sh \ + $PKG/usr/doc/$PRGNAM-$VERSION/db + +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/office/SOGo/SOGo.info b/office/SOGo/SOGo.info new file mode 100644 index 0000000000..1760f7c146 --- /dev/null +++ b/office/SOGo/SOGo.info @@ -0,0 +1,10 @@ +PRGNAM="SOGo" +VERSION="4.0.2" +HOMEPAGE="https://sogo.nu/" +DOWNLOAD="https://sogo.nu/files/downloads/SOGo/Sources/SOGo-4.0.2.tar.gz" +MD5SUM="852fb13d391906e61d3ae4c78f48b80e" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="SOPE libmemcached" +MAINTAINER="Chris Walker" +EMAIL="kris240376@gmail.com" diff --git a/office/SOGo/doinst.sh b/office/SOGo/doinst.sh new file mode 100644 index 0000000000..723602cbbe --- /dev/null +++ b/office/SOGo/doinst.sh @@ -0,0 +1,31 @@ +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/cron.d/sogo.new +preserve_perms etc/cron.daily/sogo.new +config etc/httpd/extra/httpd-sogo.conf.new +config etc/logrotate.d/sogo.new +preserve_perms etc/rc.d/rc.sogo.new +config etc/sogo/sogo.conf.new +config etc/sysconfig/sogo.new diff --git a/office/SOGo/rc.sogo b/office/SOGo/rc.sogo new file mode 100644 index 0000000000..014190fed5 --- /dev/null +++ b/office/SOGo/rc.sogo @@ -0,0 +1,70 @@ +#!/bin/bash +# +# /etc/rc.d/rc.sogo +# +# Start/stop/restart the SOGo groupware server. +# +# This script was inspired by the RHEL init.d script present in the +# SOGo source Scripts directory. +# + +# These values are defaults. You can update the USER and PREFORK values +# by making changes to /etc/sysconfig/sogo. +USER=sogo +PREFORK=3 + +PIDFILE=/var/run/sogo/sogo.pid +LOGFILE=/var/log/sogo/sogo.log + +if [ -f /etc/sysconfig/sogo ]; then + . /etc/sysconfig/sogo +fi + +DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE" + +if [ -z "$GNUSTEP_SYSTEM_ROOT" ]; then + . /etc/GNUstep/GNUstep.conf + . ${GNUSTEP_MAKEFILES}/GNUstep.sh +fi + +sogo_start() { + pid="$(cat $PIDFILE 2> /dev/null)" + if [ -n "$pid" ]; then + pid="$(ps --pid ${pid} -o pid=)" + if [ ! -n "$pid" ]; then + rm -f $PIDFILE + su - $USER -c "nohup /usr/sbin/sogod $DAEMON_OPTS >/dev/null 2>&1" + echo "Starting SOGo: /usr/sbin/sogod $DAEMON_OPTS" + fi + else + su - $USER -c "nohup /usr/sbin/sogod $DAEMON_OPTS >/dev/null 2>&1" + echo "Starting SOGo: /usr/sbin/sogod $DAEMON_OPTS" + fi +} + +sogo_stop() { + pid="$(cat $PIDFILE 2> /dev/null)" + if [ -n "$pid" ]; then + pid="$(ps --pid ${pid} -o pid=)" + if [ -n "$pid" ]; then + kill $pid >& /dev/null + echo "Stopping SOGo..." + fi + fi +} + +case "$1" in + start) + sogo_start + ;; + stop) + sogo_stop + ;; + restart) + sogo_stop + sleep 2 + sogo_start + ;; + *) + sogo_start +esac diff --git a/office/SOGo/slack-desc b/office/SOGo/slack-desc new file mode 100644 index 0000000000..0c1564f5fb --- /dev/null +++ b/office/SOGo/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------------------------------------------------------| +SOGo: SOGo (open source groupware) +SOGo: +SOGo: SOGo is a fully supported and trusted groupware server with a focus +SOGo: on scalability and open standards. SOGo is released under the GNU +SOGo: GPL/LGPL v2 and above. +SOGo: +SOGo: SOGo provides a rich AJAX-based Web interface and supports multiple +SOGo: native clients through the use of standard protocols such as CalDAV, +SOGo: CardDAV and GroupDAV, as well as Microsoft ActiveSync. +SOGo: +SOGo: Homepage: https://sogo.nu -- cgit v1.2.3