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