summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Saegebarth <marc@mos6581.de>2014-11-19 23:00:38 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-11-19 23:30:10 +0700
commit13889c1313bc8bc57bfbc7f849f8694c9eeb0d1d (patch)
tree86bf58230149a93848b245cc3dde46e6d1660be9
parent7de3191028874a308a8e1601c5a1bfc411ba8ef5 (diff)
downloadslackbuilds-13889c1313bc8bc57bfbc7f849f8694c9eeb0d1d.tar.gz
system/profile-sync-daemon: Added (Manage browser profiles).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--system/profile-sync-daemon/README11
-rw-r--r--system/profile-sync-daemon/doinst.sh27
-rw-r--r--system/profile-sync-daemon/profile-sync-daemon.SlackBuild70
-rw-r--r--system/profile-sync-daemon/profile-sync-daemon.info10
-rw-r--r--system/profile-sync-daemon/psd.openrc.patch65
-rw-r--r--system/profile-sync-daemon/slack-desc19
6 files changed, 202 insertions, 0 deletions
diff --git a/system/profile-sync-daemon/README b/system/profile-sync-daemon/README
new file mode 100644
index 0000000000..85fd15ed1b
--- /dev/null
+++ b/system/profile-sync-daemon/README
@@ -0,0 +1,11 @@
+Profile-sync-daemon (psd) is a tiny pseudo-daemon designed to manage
+your browser's profile in tmpfs and to periodically sync it back to
+your physical disc (HDD/SSD). This is accomplished via a symlinking
+step and an innovative use of rsync to maintain back-up and
+synchronization between the two. One of the major design goals of
+psd is a completely transparent user experience.
+
+Note:
+I strongly encourage reading the ArchWiki article
+https://wiki.archlinux.org/index.php/Profile-sync-daemon
+before starting, and stopping the daemon in /etc/rc.d/rc.local_shutdown.
diff --git a/system/profile-sync-daemon/doinst.sh b/system/profile-sync-daemon/doinst.sh
new file mode 100644
index 0000000000..dd0e684583
--- /dev/null
+++ b/system/profile-sync-daemon/doinst.sh
@@ -0,0 +1,27 @@
+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.psd.new
+config etc/cron.hourly/psd-update.new
+config etc/psd.conf.new
diff --git a/system/profile-sync-daemon/profile-sync-daemon.SlackBuild b/system/profile-sync-daemon/profile-sync-daemon.SlackBuild
new file mode 100644
index 0000000000..8fe6491ef2
--- /dev/null
+++ b/system/profile-sync-daemon/profile-sync-daemon.SlackBuild
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# SlackBuild script for "profile-sync-daemon".
+# Copyright 2014 Marcel Saegebarth <marc@mos6581.de>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT
+# OWNER OR CONTRIBUTORS 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=profile-sync-daemon
+VERSION=${VERSION:-5.52}
+ARCH=noarch
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+rm -rf $TMP/$PRGNAM-$VERSION
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+tar xvf $CWD/v$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 {} \;
+
+sed -i 's#/share##g' Makefile
+patch -p1 < $CWD/psd.openrc.patch
+make
+make install-bin install-man install-cron DESTDIR=$PKG
+
+mv $PKG/etc/cron.hourly/psd-update $PKG/etc/cron.hourly/psd-update.new
+install -D -m 0644 $TMP/$PRGNAM-$VERSION/common/psd.conf $PKG/etc/psd.conf.new
+install -D -m 0644 $TMP/$PRGNAM-$VERSION/init/psd.openrc $PKG/etc/rc.d/rc.psd.new
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a GPL-2 INSTALL LICENCE MIT README.md VERSION_4_WARNING $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir $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/system/profile-sync-daemon/profile-sync-daemon.info b/system/profile-sync-daemon/profile-sync-daemon.info
new file mode 100644
index 0000000000..a753f4fbc4
--- /dev/null
+++ b/system/profile-sync-daemon/profile-sync-daemon.info
@@ -0,0 +1,10 @@
+PRGNAM="profile-sync-daemon"
+VERSION="5.52"
+HOMEPAGE="https://github.com/graysky2/profile-sync-daemon/"
+DOWNLOAD="https://github.com/graysky2/profile-sync-daemon/archive/v5.52.tar.gz"
+MD5SUM="be20f5d7068144c214f664e96d1d0e2b"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Marcel Saegebarth"
+EMAIL="marc@mos6581.de"
diff --git a/system/profile-sync-daemon/psd.openrc.patch b/system/profile-sync-daemon/psd.openrc.patch
new file mode 100644
index 0000000000..6c8e83eb32
--- /dev/null
+++ b/system/profile-sync-daemon/psd.openrc.patch
@@ -0,0 +1,65 @@
+--- profile-sync-daemon/init/psd.openrc.orig 2014-11-19 14:35:06.049935645 +0100
++++ profile-sync-daemon/init/psd.openrc 2014-11-19 14:37:33.235934241 +0100
+@@ -1,29 +1,21 @@
+-#!/sbin/runscript
++#!/bin/sh
+ # Copyright 1999-2014 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
++# Adapted by Marcel Saegebarth for slackbuilds.org for
++# http://slackbuilds.org/result/?search=profile-sync-daemon.
+
+ description="Webbrowser profile syncing"
+ extra_commands="resync"
+ description_resync="Manually sync the disk profile with running tmpfs image"
+
+-
+-depend() {
+- need devfs localmount
+- after swapfiles # bug 398431#c8
+-}
+-
+ start() {
+- ebegin "Starting Profile-Sync-Daemon"
+-
++ echo "Starting Profile-Sync-Daemon"
+ /usr/bin/profile-sync-daemon sync
+- eend $?
+ }
+
+ stop() {
+- ebegin "Stopping Profile-Sync-Daemon"
+-
++ echo "Stopping Profile-Sync-Daemon"
+ /usr/bin/profile-sync-daemon unsync
+- eend $?
+ }
+
+ status() {
+@@ -31,7 +23,25 @@
+ }
+
+ resync() {
+- ebegin "Syncing browser profiles in tmpfs to physical disc"
++ echo "Syncing browser profiles in tmpfs to physical disc"
+ /usr/bin/profile-sync-daemon resync
+- eend $?
+ }
++
++case "$1" in
++ start)
++ start
++ ;;
++ stop)
++ stop
++ ;;
++ resync)
++ resync
++ ;;
++
++ status)
++ status
++ ;;
++ *)
++ echo $"Usage: $0 {start|stop|resync|status}"
++ exit 1
++esac
diff --git a/system/profile-sync-daemon/slack-desc b/system/profile-sync-daemon/slack-desc
new file mode 100644
index 0000000000..c3bfd3cf11
--- /dev/null
+++ b/system/profile-sync-daemon/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------------------------------------------------------|
+profile-sync-daemon: profile-sync-daemon (Manage browser profiles in tmpfs)
+profile-sync-daemon:
+profile-sync-daemon: Profile-sync-daemon (psd) is a tiny pseudo-daemon designed to manage
+profile-sync-daemon: your browser's profile in tmpfs and to periodically sync it back to
+profile-sync-daemon: your physical disc (HDD/SSD). This is accomplished via a symlinking
+profile-sync-daemon: step and an innovative use of rsync to maintain back-up and
+profile-sync-daemon: synchronization between the two. One of the major design goals of
+profile-sync-daemon: psd is a completely transparent user experience.
+profile-sync-daemon:
+profile-sync-daemon: Homepage: https://github.com/graysky2/profile-sync-daemon/
+profile-sync-daemon: