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