wok view backuppc/receipt @ rev 24440

Update some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 13 21:29:13 2022 +0000 (2022-02-13)
parents 4b2bd5a4b92c
children 7dd01dedad38
line source
1 # SliTaz package receipt.
3 PACKAGE="backuppc"
4 SOURCE="BackupPC"
5 VERSION="3.3.2"
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"
15 TAGS="backup"
17 DEPENDS="tar perl-file-rsync perl perl-compress-raw-zlib perl-archive-zip \
18 rsync bzip2 perl-xml-rss perl-net-ftp \
19 perl-net-ftp-retrhandle perl-net-ftp-autoreconnect smbclient postfix \
20 bzip2 openssh perl-libwww"
21 BUILD_DEPENDS="par2"
23 # What is the latest version available today?
24 current_version()
25 {
26 wget -O - https://sourceforge.net/projects/backuppc/files/backuppc/ 2>/dev/null | \
27 sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
28 sed '/scope="row/!d;s|.*/backuppc/||;s|/.*||;q'
29 }
31 # Rules to configure and make the package.
32 compile_rules()
33 {
34 mkdir -p $DESTDIR/etc/apache/conf.d
35 grep -q share/BackupPC/doc configure.pl ||
36 sed -i -e 's|/doc|/share/BackupPC/doc|' \
37 -e 's|bin doc|bin share/BackupPC/doc|' \
38 configure.pl
39 perl configure.pl --batch --dest-dir=$DESTDIR --install-dir=/usr \
40 --data-dir=/var/lib/BackupPC --config-dir=/etc/BackupPC \
41 --log-dir=/var/log/BackupPC --backuppc-user=www \
42 --hostname=localhost --html-dir=/usr/share/BackupPC/www \
43 --html-dir-url=/BackupPC/img \
44 --cgi-dir=/usr/share/BackupPC/cgi &&
45 cp httpd/BackupPC.conf $DESTDIR/etc/apache/conf.d
46 }
48 # Rules to gen a SliTaz package suitable for Tazpkg.
49 genpkg_rules()
50 {
51 cp -a $install/* $fs
52 cp -a $stuff/* $fs
53 sed -i -e "s/''http/'http/;s/min''/min'/" \
54 -e 's/-E -N -d/-E -d/' \
55 -e "s/^\\\$Conf{CgiAdminUsers}.*/\$Conf{CgiAdminUsers} = 'root';/" \
56 -e 's|sshPath -q -x|sshPath -o UserKnownHostsFile=/etc/BackupPC/.ssh/known_hosts -i /etc/BackupPC/.ssh/id_rsa -q -x|' \
57 $fs/etc/BackupPC/config.pl
58 chown www.www $fs/etc/BackupPC/config.pl
59 chmod 755 $fs/etc $fs/var $fs/var/*
60 mkdir -p $install/usr/share/doc
61 cp $src/doc/*.html $src/README $install/usr/share/doc
62 }
64 post_install()
65 {
66 grep -qs backuppc "$1/etc/rcS.conf" ||
67 sed -i 's/^RUN_DAEMONS="/RUN_DAEMONS="backuppc /' "$1/etc/rcS.conf"
68 loc=$LANG
69 [ -s "$1/usr/lib/BackupPC/Lang/$loc.pm" ] || loc=${loc:0:2}
70 [ -s "$1/usr/lib/BackupPC/Lang/$loc.pm" ] &&
71 sed -i "s/'en'/'$loc'/" "$1/etc/BackupPC/config.pl"
72 [ -x /usr/bin/par2 ] &&
73 sed -i 's/{ArchivePar} =.*/{ArchivePar} = 5;/' "$1/etc/BackupPC/config.pl"
74 if [ ! -d "$1/etc/BackupPC/.ssh" ]; then
75 mkdir "$1/etc/BackupPC/.ssh"
76 chroot "$1/" ssh-keygen -t rsa -f /etc/BackupPC/.ssh/id_rsa -C '' -N ''
77 fi
78 if [ -z "$1" ]; then
79 /etc/init.d/apache stop
80 sleep 2
81 /etc/init.d/backuppc start
82 /etc/init.d/apache start
83 fi
84 cat <<EOT
86 Now you should :
87 - append /etc/BackupPC/.ssh/id_rsa.pub to every unix client /root/.ssh/authorized_keys file
88 - update \$Conf{CgiAdminUsers} in /etc/BackupPC/config.pl
89 - enable web access with 'htpasswd -c root /etc/BackupPC/BackupPC.users'
90 - update passwords in /etc/BackupPC/*.sh
91 - ... and maybe jail /var/lib/BackupPC into a xfs/noatime for ext4 users.
92 EOT
93 }