wok view backuppc/receipt @ rev 9283

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