SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "backuppc"

# SliTaz package receipt.

PACKAGE="backuppc"
SOURCE="BackupPC"
VERSION="3.3.2"
CATEGORY="network"
SHORT_DESC="high-performance, enterprise-grade system for backing up Linux"
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
TARBALL="$SOURCE-$VERSION.tar.gz"
WEB_SITE="https://backuppc.github.io/backuppc/"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
SUGGESTED="par2"
CONFIG_FILES="/etc/BackupPC/config.pl"
TAGS="backup"

DEPENDS="tar perl-file-rsync perl perl-compress-raw-zlib perl-archive-zip \
rsync bzip2 perl-xml-rss perl-net-ftp \
perl-net-ftp-retrhandle perl-net-ftp-autoreconnect smbclient postfix \
bzip2 openssh perl-libwww"
BUILD_DEPENDS="par2"

# What is the latest version available today?
current_version()
{
    wget -O - $WEB_SITE 2>/dev/null | \
    sed '/latest release/!d;s|.*tag/||;s|".*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    mkdir -p $DESTDIR/etc/apache/conf.d
    grep -q share/BackupPC/doc configure.pl ||
    sed -i -e 's|/doc|/share/BackupPC/doc|' \
        -e 's|bin doc|bin share/BackupPC/doc|' \
        configure.pl
    perl configure.pl --batch --dest-dir=$DESTDIR --install-dir=/usr \
        --data-dir=/var/lib/BackupPC --config-dir=/etc/BackupPC \
        --log-dir=/var/log/BackupPC --backuppc-user=www \
        --hostname=localhost --html-dir=/usr/share/BackupPC/www \
        --html-dir-url=/BackupPC/img \
        --cgi-dir=/usr/share/BackupPC/cgi &&
    cp httpd/BackupPC.conf $DESTDIR/etc/apache/conf.d
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    cp -a $install/* $fs
    cp -a $stuff/* $fs
    sed -i -e "s/''http/'http/;s/min''/min'/" \
           -e 's/-E -N -d/-E -d/' \
           -e "s/^\\\$Conf{CgiAdminUsers}.*/\$Conf{CgiAdminUsers} = 'root';/" \
           -e 's|sshPath -q -x|sshPath -o UserKnownHostsFile=/etc/BackupPC/.ssh/known_hosts -i /etc/BackupPC/.ssh/id_rsa -q -x|' \
        $fs/etc/BackupPC/config.pl
    chown www.www $fs/etc/BackupPC/config.pl
    chmod 755 $fs/etc $fs/var $fs/var/*
    mkdir -p $install/usr/share/doc
    cp $src/doc/*.html $src/README $install/usr/share/doc
}

post_install()
{
    grep -qs backuppc "$1/etc/rcS.conf" ||
    sed -i 's/^RUN_DAEMONS="/RUN_DAEMONS="backuppc /' "$1/etc/rcS.conf"
    loc=$LANG
    [ -s "$1/usr/lib/BackupPC/Lang/$loc.pm" ] || loc=${loc:0:2}
    [ -s "$1/usr/lib/BackupPC/Lang/$loc.pm" ] &&
    sed -i "s/'en'/'$loc'/" "$1/etc/BackupPC/config.pl"
    [ -x /usr/bin/par2 ] &&
    sed -i 's/{ArchivePar} =.*/{ArchivePar} = 5;/' "$1/etc/BackupPC/config.pl"
    if [ ! -d "$1/etc/BackupPC/.ssh" ]; then
        mkdir "$1/etc/BackupPC/.ssh"
        chroot "$1/" ssh-keygen -t rsa -f /etc/BackupPC/.ssh/id_rsa -C '' -N ''
    fi
    if [ -z "$1" ]; then
        /etc/init.d/apache stop
        sleep 2
        /etc/init.d/backuppc start
        /etc/init.d/apache start
    fi
    cat <<EOT

Now you should :
- append /etc/BackupPC/.ssh/id_rsa.pub to every unix client /root/.ssh/authorized_keys file
- update \$Conf{CgiAdminUsers} in /etc/BackupPC/config.pl 
- enable web access with 'htpasswd -c root /etc/BackupPC/BackupPC.users'
- update passwords in /etc/BackupPC/*.sh
- ... and maybe jail /var/lib/BackupPC into a xfs/noatime for ext4 users.
EOT
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)