summaryrefslogtreecommitdiff
path: root/network/syncthing/syncthing.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/syncthing/syncthing.SlackBuild')
-rw-r--r--network/syncthing/syncthing.SlackBuild24
1 files changed, 20 insertions, 4 deletions
diff --git a/network/syncthing/syncthing.SlackBuild b/network/syncthing/syncthing.SlackBuild
index 69992495f5..8a154a675b 100644
--- a/network/syncthing/syncthing.SlackBuild
+++ b/network/syncthing/syncthing.SlackBuild
@@ -1,6 +1,7 @@
#!/bin/sh
# Slackware build script for syncthing
# Copyright 2015 Lionel Young, United States
+# Copyright 2016 Sebastian Arcus, United Kingdom
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,7 +22,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=syncthing
-VERSION=${VERSION:-0.11.10}
+VERSION=${VERSION:-0.13.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -49,6 +50,14 @@ OUTPUT=${OUTPUT:-/tmp}
set -e
+# Check if the syncthing user and group exist. If not, then bail.
+if [ "$(id -g syncthing 2> /dev/null)" != "307" -o "$(id -u syncthing 2> /dev/null)" != "307" ]; then
+ echo " You must have an 'syncthing' user and group to run this script."
+ echo " # groupadd -g 307 syncthing"
+ echo " # useradd -d /var/lib/syncthing -g syncthing -s /bin/bash -u 307 syncthing"
+ exit 1
+fi
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -71,12 +80,19 @@ install -Dm755 syncthing $PKG/usr/bin/syncthing
# Install rc script
mkdir -p $PKG/etc/rc.d
cat $CWD/rc.syncthing > $PKG/etc/rc.d/rc.syncthing.new
+chmod 0644 $PKG/etc/rc.d/rc.syncthing.new
+
+# Install logrotate script
+mkdir -p $PKG/etc/logrotate.d
+cat $CWD/syncthing.logrotate > $PKG/etc/logrotate.d/syncthing.new
-mkdir -p $PKG/var/lib/syncthing
-mkdir -p $PKG/var/run/syncthing
+mkdir -p -m 750 $PKG/var/lib/syncthing/config
+mkdir -p -m 750 $PKG/var/log/syncthing
+mkdir -p -m 750 $PKG/var/run/syncthing
+chown -R syncthing.syncthing $PKG/var/{lib,run,log}/syncthing
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a *.txt *.pdf $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a *.txt extra/*.pdf $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install