diff options
Diffstat (limited to 'network/etherpad-lite')
-rw-r--r-- | network/etherpad-lite/doinst.sh | 30 | ||||
-rw-r--r-- | network/etherpad-lite/etherpad-lite.SlackBuild | 9 |
2 files changed, 34 insertions, 5 deletions
diff --git a/network/etherpad-lite/doinst.sh b/network/etherpad-lite/doinst.sh new file mode 100644 index 0000000000..544d5c4eec --- /dev/null +++ b/network/etherpad-lite/doinst.sh @@ -0,0 +1,30 @@ +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 +} + +preserve_perms etc/rc.d/rc.etherpad-lite.new +config etc/etherpad-lite/settings.json.new + +touch var/log/$PRGNAM/etherpad.log +touch var/log/$PRGNAM/error.log + diff --git a/network/etherpad-lite/etherpad-lite.SlackBuild b/network/etherpad-lite/etherpad-lite.SlackBuild index 27a25c8609..6fb8cca94c 100644 --- a/network/etherpad-lite/etherpad-lite.SlackBuild +++ b/network/etherpad-lite/etherpad-lite.SlackBuild @@ -63,14 +63,12 @@ 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 +chown $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 +install -D -m 0755 $CWD/rc.etherpad-lite $PKG/etc/rc.d/rc.etherpad-lite.new cat settings.json.template > $PKG/etc/$PRGNAM/settings.json.template -cat settings.json.template > $PKG/etc/$PRGNAM/settings.json +cat settings.json.template > $PKG/etc/$PRGNAM/settings.json.new mkdir -p $PKG/srv ln -sf /var/$PRGNAM $PKG/srv/$PRGNAM @@ -82,6 +80,7 @@ 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/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |