wok-current view backuppc/receipt @ rev 18867
Up shellinabox (2.14)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 01 23:23:12 2016 +0100 (2016-02-01) |
parents | fca172c323cf |
children | 74a3c282b4ca |
line source
1 # SliTaz package receipt.
3 PACKAGE="backuppc"
4 SOURCE="BackupPC"
5 VERSION="3.2.1"
6 CATEGORY="network"
7 SHORT_DESC="high-performance, enterprise-grade system for backing up Linux"
8 MAINTAINER="pascal.bellard@slitaz.org"
9 LICENSE="GPL2"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="http://backuppc.sourceforge.net/"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
13 SUGGESTED="par2"
14 CONFIG_FILES="/etc/BackupPC/config.pl"
15 TAGS="backup"
17 DEPENDS="tar perl-file-rsync perl perl-compress-raw-zlib perl-archive-zip \
18 rsync bzip2 perl-xml-rss perl-net-ftp \
19 perl-net-ftp-retrhandle perl-net-ftp-autoreconnect smbclient postfix \
20 bzip2 openssh perl-libwww"
21 BUILD_DEPENDS="par2"
23 # Rules to configure and make the package.
24 compile_rules()
25 {
26 cd $src
27 mkdir -p $DESTDIR/etc/apache/conf.d
28 grep -q share/BackupPC/doc configure.pl ||
29 sed -i -e 's|/doc|/share/BackupPC/doc|' \
30 -e 's|bin doc|bin share/BackupPC/doc|' \
31 configure.pl
32 perl configure.pl --batch --dest-dir=$DESTDIR --install-dir=/usr \
33 --data-dir=/var/lib/BackupPC --config-dir=/etc/BackupPC \
34 --log-dir=/var/log/BackupPC --backuppc-user=www \
35 --hostname=localhost --html-dir=/usr/share/BackupPC/www \
36 --html-dir-url=/BackupPC/img \
37 --cgi-dir=/usr/share/BackupPC/cgi &&
38 cp httpd/BackupPC.conf $DESTDIR/etc/apache/conf.d
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 cp -a $install/* $fs
45 cp -a $stuff/* $fs
46 sed -i -e "s/''http/'http/;s/min''/min'/" \
47 -e 's/-E -N -d/-E -d/' \
48 -e "s/^\\\$Conf{CgiAdminUsers}.*/\$Conf{CgiAdminUsers} = 'root';/" \
49 -e 's|sshPath -q -x|sshPath -o UserKnownHostsFile=/etc/BackupPC/.ssh/known_hosts -i /etc/BackupPC/.ssh/id_rsa -q -x|' \
50 $fs/etc/BackupPC/config.pl
51 chown www.www $fs/etc/BackupPC/config.pl
52 chmod 755 $fs/etc $fs/var $fs/var/*
53 }
55 post_install()
56 {
57 grep -qs backuppc "$1/etc/rcS.conf" ||
58 sed -i 's/^RUN_DAEMONS="/RUN_DAEMONS="backuppc /' "$1/etc/rcS.conf"
59 loc=$LANG
60 [ -s "$1/usr/lib/BackupPC/Lang/$loc.pm" ] || loc=${loc:0:2}
61 [ -s "$1/usr/lib/BackupPC/Lang/$loc.pm" ] &&
62 sed -i "s/'en'/'$loc'/" "$1/etc/BackupPC/config.pl"
63 [ -x /usr/bin/par2 ] &&
64 sed -i 's/{ArchivePar} =.*/{ArchivePar} = 5;/' "$1/etc/BackupPC/config.pl"
65 if [ ! -d "$1/etc/BackupPC/.ssh" ]; then
66 mkdir "$1/etc/BackupPC/.ssh"
67 chroot "$1/" ssh-keygen -t rsa -f /etc/BackupPC/.ssh/id_rsa -C '' -N ''
68 fi
69 if [ -z "$1" ]; then
70 /etc/init.d/apache stop
71 sleep 2
72 /etc/init.d/backuppc start
73 /etc/init.d/apache start
74 fi
75 cat <<EOT
77 Now you should :
78 - append /etc/BackupPC/.ssh/id_rsa.pub to every unix client /root/.ssh/authorized_keys file
79 - update \$Conf{CgiAdminUsers} in /etc/BackupPC/config.pl
80 - enable web access with 'htpasswd -c root /etc/BackupPC/BackupPC.users'
81 - update passwords in /etc/BackupPC/*.sh
82 EOT
83 }