SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "boxbackup-client"

# SliTaz package receipt.

PACKAGE="boxbackup-client"
VERSION="0.12"
CATEGORY="network"
TAGS="backup automatic client"
SHORT_DESC="Client for the BoxBackup on-line backup system."
MAINTAINER="domcox@slitaz.org"
LICENSE="GPL2"
WEB_SITE="https://www.boxbackup.org/"

SOURCE="boxbackup"
DEPENDS="db gcc-lib-base libedit libssl perl zlib"
WANTED="boxbackup-server"

# Configuration variables
CONF_DIR="/etc/boxbackup"
DATA_DIR="/var/lib/bbackupd"
RUN_DMON=0

# Rules to gen a SliTaz package suitable for Tazpkg
genpkg_rules()
{
    mkdir -p $fs/usr/bin
    mkdir -p $fs/etc/init.d

    cp -a $install/boxbackup-git_-backup-client-i486-slitaz-linux-gnu/bb* \
                $fs/usr/bin
    rm -f            $fs/usr/bin/*.*
    cp -a $stuff/bbackupd    $fs/etc/init.d
}

# Pre and post install commands for Tazpkg

pre_install()
{
    # Stop daemon
    if [ -z "$1" -a -e /var/run/bbackupd.pid ]
      then
        /etc/init.d/bbackupd stop
        RUN_DMON=1
    fi
}

post_install()
{
    # Creating configuration directory
    if [ ! -e "$1/$CONF_DIR" ]
      then
        mkdir -p "$1/$CONF_DIR" && chmod 755 "$1/$CONF_DIR"
    fi

    # Create data directory
    if [ ! -e "$1/$DATA_DIR" ]
      then
        mkdir -p "$1/$DATA_DIR" && chmod 700 "$1/$DATA_DIR"
    fi

    if [ -z "$1" ]
      then
        # Start daemon (if stopped by install)
        if [ $RUN_DMON -eq 1 ]
          then
            /etc/init.d/bbackupd start
        fi
    fi
    true
}

# Pre and post remove commands for Tazpkg

pre_remove()
{
    # Stop daemon
    if [ -z "$1" ]
      then
        if [ -e /var/run/bbackupd.pid ]
          then
            /etc/init.d/bbackupd stop
        fi
    fi
}

post_remove()
{
    # Delete DATA directory
    rm -rf "$1/$DATA_DIR"

    # Delete Client configuration file
    rm -rf "$1/$CONF_DIR"/bbackupd*

    # Delete CONF dir (if empty)
    if [ $(ls -lA "$1/$CONF_DIR" | wc -l) -eq 0 ]
      then
        echo
        action "Removing $CONF_DIR..."
        rm -rf "$1/$CONF_DIR"
        status
    fi

    # Delete PID, sock files
    rm -f "$1/var/run/bbackupd".*
}

6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)