wok view backuppc/receipt @ rev 9282

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