wok-6.x view backuppc/receipt @ rev 17564

Up: hexchat 2.10.2
author Alexander Medvedev <devl547@gmail.com>
date Sat Feb 07 17:14:34 2015 +0000 (2015-02-07)
parents ee5c8b018b62
children 4ea96657834e
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"
16 DEPENDS="tar perl-file-rsync perl perl-compress-raw-zlib perl-archive-zip \
17 rsync bzip2 perl-xml-rss perl-net-ftp \
18 perl-net-ftp-retrhandle perl-net-ftp-autoreconnect smbclient postfix \
19 bzip2 openssh perl-libwww"
20 BUILD_DEPENDS="par2"
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 cd $src
26 mkdir -p $DESTDIR/etc/apache/conf.d
27 grep -q share/BackupPC/doc configure.pl ||
28 sed -i -e 's|/doc|/share/BackupPC/doc|' \
29 -e 's|bin doc|bin share/BackupPC/doc|' \
30 configure.pl
31 perl configure.pl --batch --dest-dir=$DESTDIR --install-dir=/usr \
32 --data-dir=/var/lib/BackupPC --config-dir=/etc/BackupPC \
33 --log-dir=/var/log/BackupPC --backuppc-user=www \
34 --hostname=localhost --html-dir=/usr/share/BackupPC/www \
35 --html-dir-url=/BackupPC/img \
36 --cgi-dir=/usr/share/BackupPC/cgi &&
37 cp httpd/BackupPC.conf $DESTDIR/etc/apache/conf.d
38 }
40 # Rules to gen a SliTaz package suitable for Tazpkg.
41 genpkg_rules()
42 {
43 cp -a $install/* $fs
44 cp -a $stuff/* $fs
45 sed -i -e "s/''http/'http/;s/min''/min'/" \
46 -e 's/-E -N -d/-E -d/' \
47 -e "s/^\\\$Conf{CgiAdminUsers}.*/\$Conf{CgiAdminUsers} = 'root';/" \
48 -e 's|sshPath -q -x|sshPath -o UserKnownHostsFile=/etc/BackupPC/.ssh/known_hosts -i /etc/BackupPC/.ssh/id_rsa -q -x|' \
49 $fs/etc/BackupPC/config.pl
50 chown www.www $fs/etc/BackupPC/config.pl
51 chmod 755 $fs/etc $fs/var $fs/var/*
52 }
54 post_install()
55 {
56 grep -qs backuppc $1/etc/rcS.conf ||
57 sed -i 's/^RUN_DAEMONS="/RUN_DAEMONS="backuppc /' $1/etc/rcS.conf
58 loc=$LANG
59 [ -s $1/usr/lib/BackupPC/Lang/$loc.pm ] || loc=${loc:0:2}
60 [ -s $1/usr/lib/BackupPC/Lang/$loc.pm ] &&
61 sed -i "s/'en'/'$loc'/" $1/etc/BackupPC/config.pl
62 [ -x /usr/bin/par2 ] &&
63 sed -i 's/{ArchivePar} =.*/{ArchivePar} = 5;/' $1/etc/BackupPC/config.pl
64 if [ ! -d $1/etc/BackupPC/.ssh ]; then
65 mkdir $1/etc/BackupPC/.ssh
66 chroot $1/ ssh-keygen -t rsa -f /etc/BackupPC/.ssh/id_rsa -C '' -N ''
67 fi
68 if [ -z "$1" ]; then
69 /etc/init.d/apache stop
70 sleep 2
71 /etc/init.d/backuppc start
72 /etc/init.d/apache start
73 fi
74 cat <<EOT
75 Now you should :
76 - append $1/etc/BackupPC/.ssh/id_rsa.pub to every unix client /root/.ssh/authorized_keys file
77 - update \$Conf{CgiAdminUsers} in $1/etc/BackupPC/config.pl
78 - enable web access with 'htpasswd -c root /etc/BackupPC/BackupPC.users'
79 - update passwords in /etc/BackupPC/*.sh
80 EOT
81 }