wok diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/backuppc/receipt	Wed Mar 16 09:13:12 2011 +0100
     1.3 @@ -0,0 +1,74 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="backuppc"
     1.7 +SOURCE="BackupPC"
     1.8 +VERSION="3.2.0"
     1.9 +CATEGORY="network"
    1.10 +SHORT_DESC="high-performance, enterprise-grade system for backing up Linux"
    1.11 +MAINTAINER="pascal.bellard@slitaz.org"
    1.12 +TARBALL="$SOURCE-$VERSION.tar.gz"
    1.13 +WEB_SITE="http://backuppc.sourceforge.net/"
    1.14 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.15 +DEPENDS="tar perl-file-rsync perl perl-compress-raw-zlib perl-archive-zip \
    1.16 +rsync bzip2 apache-mod-perl perl-xml-rss perl-net-ftp \
    1.17 +perl-net-ftp-retrhandle perl-net-ftp-autoreconnect smbclient samba postfix \
    1.18 +bzip2 openssh perl-lwp-useragent"
    1.19 +BUILD_DEPENDS="par2"
    1.20 +SUGGESTED="par2"
    1.21 +CONFIG_FILES="/etc/BackupPC/config.pl"
    1.22 +
    1.23 +# Rules to configure and make the package.
    1.24 +compile_rules()
    1.25 +{
    1.26 +	cd $src
    1.27 +	mkdir -p $PWD/_pkg/etc/apache/conf.d
    1.28 +	cp httpd/BackupPC.conf $PWD/_pkg/etc/apache/conf.d
    1.29 +	perl configure.pl --batch --dest-dir=$PWD/_pkg --install-dir=/usr \
    1.30 +		--data-dir=/var/lib/BackupPC --config-dir=/etc/BackupPC \
    1.31 +		--log-dir=/var/log/BackupPC --backuppc-user=www \
    1.32 +		--hostname=localhost --html-dir=/usr/share/BackupPC/www \
    1.33 +		--html-dir-url=/BackupPC/img --cgi-dir=/usr/share/BackupPC/cgi
    1.34 +}
    1.35 +
    1.36 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.37 +genpkg_rules()
    1.38 +{
    1.39 +	cp -a $_pkg/* $fs
    1.40 +	cp -a stuff/* $fs
    1.41 +	sed -i -e "s/''http/'http/;s/min''/min'/" \
    1.42 +	       -e 's/-E -N -d/-E -d/' \
    1.43 +	       -e "s/^\\\$Conf{CgiAdminUsers}.*/\$Conf{CgiAdminUsers} = 'root';/" \
    1.44 +	       -e 's|sshPath -q -x|sshPath -i /etc/BackupPC/.ssh/id_rsa -q -x|' \
    1.45 +		$fs/etc/BackupPC/config.pl
    1.46 +	chown www.www $fs/etc/BackupPC/config.pl
    1.47 +	chmod 755 $fs/etc $fs/var $fs/var/*
    1.48 +}
    1.49 +
    1.50 +post_install()
    1.51 +{
    1.52 +	grep -qs backuppc $1/etc/rcS.conf ||
    1.53 +	sed -i 's/^RUN_DAEMONS="/RUN_DAEMONS="backuppc /' $1/etc/rcS.conf
    1.54 +	loc=$LANG
    1.55 +	[ -s $1/usr/lib/BackupPC/Lang/$loc.pm ] || loc=${loc:0:2}
    1.56 +	[ -s $1/usr/lib/BackupPC/Lang/$loc.pm ] &&
    1.57 +	sed -i "s/'en'/'$loc'/" $1/etc/BackupPC/config.pl
    1.58 +	[ -x /usr/bin/par2 ] &&
    1.59 +	sed -i 's/{ArchivePar} =.*/{ArchivePar} = 5;/' $1/etc/BackupPC/config.pl
    1.60 +	if [ ! -d $1/etc/BackupPC/.ssh ]; then
    1.61 +		mkdir $1/etc/BackupPC/.ssh
    1.62 +		ssh-keygen -t rsa -f $1/etc/BackupPC/.ssh/id_rsa -C '' -N ''
    1.63 +	fi
    1.64 +	if [ -z "$1" ]; then
    1.65 +		/etc/init.d/apache stop
    1.66 +		sleep 2
    1.67 +		/etc/init.d/backuppc start
    1.68 +		/etc/init.d/apache start
    1.69 +	fi
    1.70 +	cat <<EOT
    1.71 +Now you should :
    1.72 +- append $1/etc/BackupPC/.ssh/id_rsa.pub to every unix client /root/.ssh/authorized_keys file
    1.73 +- update \$Conf{CgiAdminUsers} in $1/etc/BackupPC/config.pl 
    1.74 +- enable web access with 'htpasswd -c root /etc/BackupPC/BackupPC.users'
    1.75 +- update passwords in /etc/BackupPC/*.sh
    1.76 +EOT
    1.77 +}