summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorLuke Williams <xocel@iquidus.org>2012-12-21 21:34:15 +0100
committerMatteo Bernardini <ponce@slackbuilds.org>2012-12-21 21:34:41 +0100
commitf5ff7ccd0787bbbe094fc0f7f0503a2cddc4368c (patch)
tree5d86b9907d651b1befe6140fbba1b442c9619566 /network
parent0a49058508940879bd303fe27c03f9c4a3d0675f (diff)
downloadslackbuilds-f5ff7ccd0787bbbe094fc0f7f0503a2cddc4368c.tar.gz
network/etherpad-lite: Added (real-time collaborative editor).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r--network/etherpad-lite/README15
-rw-r--r--network/etherpad-lite/README.Slackware27
-rw-r--r--network/etherpad-lite/etherpad-lite.SlackBuild88
-rw-r--r--network/etherpad-lite/etherpad-lite.info10
-rw-r--r--network/etherpad-lite/rc.etherpad-lite100
-rw-r--r--network/etherpad-lite/slack-desc19
6 files changed, 259 insertions, 0 deletions
diff --git a/network/etherpad-lite/README b/network/etherpad-lite/README
new file mode 100644
index 0000000000..91425eb693
--- /dev/null
+++ b/network/etherpad-lite/README
@@ -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.
diff --git a/network/etherpad-lite/README.Slackware b/network/etherpad-lite/README.Slackware
new file mode 100644
index 0000000000..fe45a84237
--- /dev/null
+++ b/network/etherpad-lite/README.Slackware
@@ -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
diff --git a/network/etherpad-lite/etherpad-lite.SlackBuild b/network/etherpad-lite/etherpad-lite.SlackBuild
new file mode 100644
index 0000000000..923080d741
--- /dev/null
+++ b/network/etherpad-lite/etherpad-lite.SlackBuild
@@ -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}
diff --git a/network/etherpad-lite/etherpad-lite.info b/network/etherpad-lite/etherpad-lite.info
new file mode 100644
index 0000000000..8466b99220
--- /dev/null
+++ b/network/etherpad-lite/etherpad-lite.info
@@ -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"
diff --git a/network/etherpad-lite/rc.etherpad-lite b/network/etherpad-lite/rc.etherpad-lite
new file mode 100644
index 0000000000..d2d56849e9
--- /dev/null
+++ b/network/etherpad-lite/rc.etherpad-lite
@@ -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
diff --git a/network/etherpad-lite/slack-desc b/network/etherpad-lite/slack-desc
new file mode 100644
index 0000000000..7696537c81
--- /dev/null
+++ b/network/etherpad-lite/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------------------------------------------------------|
+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/