wok view backuppc/receipt @ rev 15120

splashutils: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 14 22:02:02 2013 +0000 (2013-08-14)
parents 1916b7d701ea
children 223b265f40fd
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 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 perl-xml-rss perl-net-ftp \
14 perl-net-ftp-retrhandle perl-net-ftp-autoreconnect smbclient postfix \
15 bzip2 openssh perl-libwww"
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 _pkg/etc/apache/conf.d
25 grep -q share/BackupPC/doc configure.pl ||
26 sed -i -e 's|/doc|/share/BackupPC/doc|' \
27 -e 's|bin doc|bin share/BackupPC/doc|' \
28 configure.pl
29 perl configure.pl --batch --dest-dir=$PWD/_pkg --install-dir=/usr \
30 --data-dir=/var/lib/BackupPC --config-dir=/etc/BackupPC \
31 --log-dir=/var/log/BackupPC --backuppc-user=www \
32 --hostname=localhost --html-dir=/usr/share/BackupPC/www \
33 --html-dir-url=/BackupPC/img \
34 --cgi-dir=/usr/share/BackupPC/cgi &&
35 cp httpd/BackupPC.conf _pkg/etc/apache/conf.d
36 }
38 # Rules to gen a SliTaz package suitable for Tazpkg.
39 genpkg_rules()
40 {
41 cp -a $_pkg/* $fs
42 cp -a $stuff/* $fs
43 sed -i -e "s/''http/'http/;s/min''/min'/" \
44 -e 's/-E -N -d/-E -d/' \
45 -e "s/^\\\$Conf{CgiAdminUsers}.*/\$Conf{CgiAdminUsers} = 'root';/" \
46 -e 's|sshPath -q -x|sshPath -o UserKnownHostsFile=/etc/BackupPC/.ssh/known_hosts -i /etc/BackupPC/.ssh/id_rsa -q -x|' \
47 $fs/etc/BackupPC/config.pl
48 chown www.www $fs/etc/BackupPC/config.pl
49 chmod 755 $fs/etc $fs/var $fs/var/*
50 }
52 post_install()
53 {
54 grep -qs backuppc $1/etc/rcS.conf ||
55 sed -i 's/^RUN_DAEMONS="/RUN_DAEMONS="backuppc /' $1/etc/rcS.conf
56 loc=$LANG
57 [ -s $1/usr/lib/BackupPC/Lang/$loc.pm ] || loc=${loc:0:2}
58 [ -s $1/usr/lib/BackupPC/Lang/$loc.pm ] &&
59 sed -i "s/'en'/'$loc'/" $1/etc/BackupPC/config.pl
60 [ -x /usr/bin/par2 ] &&
61 sed -i 's/{ArchivePar} =.*/{ArchivePar} = 5;/' $1/etc/BackupPC/config.pl
62 if [ ! -d $1/etc/BackupPC/.ssh ]; then
63 mkdir $1/etc/BackupPC/.ssh
64 chroot $1/ ssh-keygen -t rsa -f /etc/BackupPC/.ssh/id_rsa -C '' -N ''
65 fi
66 if [ -z "$1" ]; then
67 /etc/init.d/apache stop
68 sleep 2
69 /etc/init.d/backuppc start
70 /etc/init.d/apache start
71 fi
72 cat <<EOT
73 Now you should :
74 - append $1/etc/BackupPC/.ssh/id_rsa.pub to every unix client /root/.ssh/authorized_keys file
75 - update \$Conf{CgiAdminUsers} in $1/etc/BackupPC/config.pl
76 - enable web access with 'htpasswd -c root /etc/BackupPC/BackupPC.users'
77 - update passwords in /etc/BackupPC/*.sh
78 EOT
79 }