mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-18 22:06:04 +01:00
network/etherpad-lite: Added (real-time collaborative editor).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
This commit is contained in:
parent
0a49058508
commit
f5ff7ccd07
6 changed files with 259 additions and 0 deletions
15
network/etherpad-lite/README
Normal file
15
network/etherpad-lite/README
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
Etherpad lite is a really-real time collaborative editor spawned
|
||||||
|
from the Hell fire of Etherpad.
|
||||||
|
We're reusing the well tested Etherpad easysync library to make it
|
||||||
|
really realtime.
|
||||||
|
Etherpad Lite is based on node.js ergo is much lighter and more
|
||||||
|
stable than the original Etherpad. Our hope is that this will
|
||||||
|
encourage more users to use and install a realtime collaborative
|
||||||
|
editor. A smaller, etherpad-lite: manageable and well documented
|
||||||
|
codebase makes it easier for developers to improve the code and
|
||||||
|
contribute towards the project.
|
||||||
|
|
||||||
|
See README.Slackware for some Slackware notes setup (with things
|
||||||
|
to do before and after building the package).
|
||||||
|
|
||||||
|
abiword (with AbiCommand plugin) is required to import/export pads.
|
27
network/etherpad-lite/README.Slackware
Normal file
27
network/etherpad-lite/README.Slackware
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
This script requires an 'etherpad' user/group to exist before
|
||||||
|
running.
|
||||||
|
The recommended UID/GID is 264. You can create these like so:
|
||||||
|
groupadd -g 264 etherpad
|
||||||
|
useradd -u 264 -g 264 -c "Etherpad lite" -m etherpad
|
||||||
|
|
||||||
|
After installation, Etherpad lite can be started with
|
||||||
|
|
||||||
|
/etc/rc.d/rc.etherpad-lite start
|
||||||
|
|
||||||
|
if you want it to start at boot, add an entry like this
|
||||||
|
in /etc/rc.d/rc.local
|
||||||
|
|
||||||
|
# Start etherpad-lite:
|
||||||
|
if [ -x /etc/rc.d/rc.etherpad-lite ]; then
|
||||||
|
/etc/rc.d/rc.etherpad-lite start
|
||||||
|
fi
|
||||||
|
|
||||||
|
to stop it at shutdown, add a similar entry substituting
|
||||||
|
"start" with "stop" in /etc/rc.d/rc.local_shutdown.
|
||||||
|
|
||||||
|
Settings can be configured in /etc/etherpad-lite/settings.json
|
||||||
|
|
||||||
|
Log files can be found in /var/log/etherpad-lite/
|
||||||
|
|
||||||
|
If you want to use it with mysql, have a look at
|
||||||
|
https://github.com/ether/etherpad-lite/wiki/How-to-use-Etherpad-Lite-with-MySQL
|
88
network/etherpad-lite/etherpad-lite.SlackBuild
Normal file
88
network/etherpad-lite/etherpad-lite.SlackBuild
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Slackware build script for etherpad-lite
|
||||||
|
#
|
||||||
|
# author: Luke Williams <xocel@iquidus.org>
|
||||||
|
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
|
||||||
|
#
|
||||||
|
|
||||||
|
PRGNAM=etherpad-lite
|
||||||
|
VERSION=${VERSION:-1.2.1}
|
||||||
|
BUILD=${BUILD:-1}
|
||||||
|
TAG=${TAG:-_SBo}
|
||||||
|
|
||||||
|
# Select etherpad's default user/group
|
||||||
|
ETHERPAD_USER=${ETHERPAD_USER:-etherpad}
|
||||||
|
ETHERPAD_UID=${ETHERPAD_UID:-264}
|
||||||
|
ETHERPAD_GROUP=${ETHERPAD_GROUP:-etherpad}
|
||||||
|
ETHERPAD_GID=${ETHERPAD_GID:-264}
|
||||||
|
|
||||||
|
# Set arch
|
||||||
|
ARCH=noarch
|
||||||
|
|
||||||
|
CWD=$(pwd)
|
||||||
|
TMP=${TMP:-/tmp/SBo}
|
||||||
|
PKG=$TMP/package-$PRGNAM
|
||||||
|
OUTPUT=${OUTPUT:-/tmp}
|
||||||
|
|
||||||
|
bailout() {
|
||||||
|
echo " You must have a $ETHERPAD_USER user and $ETHERPAD_GROUP group to run this script. "
|
||||||
|
echo " Something like this should suffice for most systems: "
|
||||||
|
echo " # groupadd -g $ETHERPAD_GID $ETHERPAD_GROUP "
|
||||||
|
echo " # useradd -u $ETHERPAD_UID -g $ETHERPAD_GID -c \"Etherpad lite\" -m $ETHERPAD_USER "
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bail if user and/or group isn't valid on your system
|
||||||
|
# uid=264 is suggested to avoid conflicts with other SBo packages,
|
||||||
|
# but it's your call: http://slackbuilds.org/uid_gid.txt
|
||||||
|
if ! grep -q "^$ETHERPAD_USER:" /etc/passwd; then
|
||||||
|
bailout
|
||||||
|
elif ! grep -q "^$ETHERPAD_GROUP:" /etc/group; then
|
||||||
|
bailout
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
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 . \
|
||||||
|
\( -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 {} \;
|
||||||
|
|
||||||
|
rm -f var/.gitignore
|
||||||
|
|
||||||
|
mkdir -p $PKG/var/$PRGNAM
|
||||||
|
cp -a * $PKG/var/$PRGNAM
|
||||||
|
chown -R $ETHERPAD_USER:$ETHERPAD_GROUP $PKG/var/$PRGNAM
|
||||||
|
|
||||||
|
mkdir -p $PKG/var/log/$PRGNAM
|
||||||
|
touch $PKG/var/log/$PRGNAM/etherpad.log
|
||||||
|
touch $PKG/var/log/$PRGNAM/error.log
|
||||||
|
chown -R $ETHERPAD_USER:$ETHERPAD_GROUP $PKG/var/log/$PRGNAM
|
||||||
|
|
||||||
|
mkdir -p $PKG/etc/rc.d $PKG/etc/$PRGNAM
|
||||||
|
install -D -m 0755 $CWD/rc.etherpad-lite $PKG/etc/rc.d/rc.etherpad-lite
|
||||||
|
cat settings.json.template > $PKG/etc/$PRGNAM/settings.json.template
|
||||||
|
cat settings.json.template > $PKG/etc/$PRGNAM/settings.json
|
||||||
|
|
||||||
|
mkdir -p $PKG/srv
|
||||||
|
ln -sf /var/$PRGNAM $PKG/srv/$PRGNAM
|
||||||
|
|
||||||
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||||
|
cp -a CHANGELOG.md CONTRIBUTING.md LICENSE README.md \
|
||||||
|
$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}
|
10
network/etherpad-lite/etherpad-lite.info
Normal file
10
network/etherpad-lite/etherpad-lite.info
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
PRGNAM="etherpad-lite"
|
||||||
|
VERSION="1.2.1"
|
||||||
|
HOMEPAGE="http://etherpad.org/"
|
||||||
|
DOWNLOAD="https://github.com/ether/etherpad-lite/archive/1.2.1.tar.gz"
|
||||||
|
MD5SUM="5a05f5c83229d90fbd1c6f0c892fa149"
|
||||||
|
DOWNLOAD_x86_64=""
|
||||||
|
MD5SUM_x86_64=""
|
||||||
|
REQUIRES="%README% node"
|
||||||
|
MAINTAINER="Luke Williams"
|
||||||
|
EMAIL="xocel@iquidus.org"
|
100
network/etherpad-lite/rc.etherpad-lite
Normal file
100
network/etherpad-lite/rc.etherpad-lite
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# rc.etherpad-lite
|
||||||
|
# Initscript that manages an instance of etherpad-Lite running on Slackware Linux.
|
||||||
|
#
|
||||||
|
# Author: Luke Williams ( xocel@iquidus.org )
|
||||||
|
# License: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
|
||||||
|
|
||||||
|
USER="etherpad"
|
||||||
|
HOMEDIR="/var/etherpad-lite"
|
||||||
|
LOGDIR="/var/log/etherpad-lite"
|
||||||
|
PIDFILE="/var/run/etherpad-lite.pid"
|
||||||
|
|
||||||
|
etherpad_start() {
|
||||||
|
echo "Starting Etherpad lite..."
|
||||||
|
# Launch etherpads run.sh script
|
||||||
|
/bin/su -l -c "$HOMEDIR/bin/run.sh -s /etc/etherpad-lite/settings.json >> $LOGDIR/etherpad.log 2>> $LOGDIR/error.log &" $USER
|
||||||
|
# Determine and store PID. In order for this to work sucessfully
|
||||||
|
# the node.js server needs to have finished launching, normally
|
||||||
|
# waiting 5 seconds is enough but in some situations (first launch
|
||||||
|
# after install for example) it can take a while longer.
|
||||||
|
PID='' # Process ID
|
||||||
|
COUNT=0 # Count attempts at determining the Process ID
|
||||||
|
TIMEOUT=9 # Number of failed attempts before exiting, default:9 (9x5=45seconds)
|
||||||
|
while [ -z "$PID" ]; do
|
||||||
|
# We don't want anyones boot process hanging here if this
|
||||||
|
# script is started on boot and etherpad is unable to lanuch.
|
||||||
|
# So exit out if etherpad appears to be failing to start.
|
||||||
|
if [ $COUNT -eq $TIMEOUT ]; then
|
||||||
|
echo "Unable to start Etherpad lite.."
|
||||||
|
cat $LOGDIR/etherpad.log | tail -n 5
|
||||||
|
rm -f "$PIDFILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Wait for node.js server to start up
|
||||||
|
sleep 5
|
||||||
|
# Store the PID
|
||||||
|
ps ax | grep [s]erver.js | awk '{print $1}' > "$PIDFILE"
|
||||||
|
# Check PID was written
|
||||||
|
PID=`cat $PIDFILE 2>/dev/null`
|
||||||
|
COUNT=$(($COUNT+1))
|
||||||
|
done
|
||||||
|
echo "Running."
|
||||||
|
}
|
||||||
|
|
||||||
|
etherpad_stop() {
|
||||||
|
echo "Stopping Etherpad lite..."
|
||||||
|
PID=`cat $PIDFILE 2>/dev/null`
|
||||||
|
if [ -z "$PID" ]; then
|
||||||
|
echo " not running."
|
||||||
|
elif kill -15 $PID; then
|
||||||
|
echo " stopped."
|
||||||
|
rm -f "$PIDFILE"
|
||||||
|
else
|
||||||
|
sleep 1
|
||||||
|
if kill -9 $PID; then
|
||||||
|
echo " killed."
|
||||||
|
rm -f "$PIDFILE"
|
||||||
|
else
|
||||||
|
echo " error!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
etherpad_status() {
|
||||||
|
PID=`cat $PIDFILE 2>/dev/null`
|
||||||
|
if [ -z "$PID" ]; then
|
||||||
|
echo "Not running."
|
||||||
|
exit 1
|
||||||
|
elif kill -0 $PID; then
|
||||||
|
echo "Running."
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "PID file $PIDFILE present but PID $PID is not running."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
etherpad_start
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
etherpad_stop
|
||||||
|
;;
|
||||||
|
|
||||||
|
restart)
|
||||||
|
etherpad_stop
|
||||||
|
sleep 3
|
||||||
|
etherpad_start
|
||||||
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
etherpad_status
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Usage $0 (start|stop|restart|status)"
|
||||||
|
esac
|
19
network/etherpad-lite/slack-desc
Normal file
19
network/etherpad-lite/slack-desc
Normal 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------------------------------------------------------|
|
||||||
|
etherpad-lite: Etherpad lite (really-real time collaborative editor)
|
||||||
|
etherpad-lite:
|
||||||
|
etherpad-lite: Etherpad lite is a really-real time collaborative editor spawned
|
||||||
|
etherpad-lite: from the Hell fire of Etherpad. We're reusing the well tested
|
||||||
|
etherpad-lite: Etherpad easysync library to make it really realtime. Etherpad Lite
|
||||||
|
etherpad-lite: is based on node.js ergo is much lighter and more stable than the
|
||||||
|
etherpad-lite: original Etherpad. Our hope is that this will encourage more users
|
||||||
|
etherpad-lite: to use and install a realtime collaborative editor. A smaller,
|
||||||
|
etherpad-lite: manageable and well documented codebase makes it easier for
|
||||||
|
etherpad-lite: developers to improve the code and contribute towards the project.
|
||||||
|
etherpad-lite: homepage: http://etherpad.org/
|
Loading…
Reference in a new issue