wok-next view boxbackup-client/receipt @ rev 13092
get-wifi-firmware: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jun 26 12:04:16 2012 +0200 (2012-06-26) |
parents | e542ba4fbc72 |
children | 223b265f40fd |
line source
1 # SliTaz package receipt.
3 PACKAGE="boxbackup-client"
4 VERSION="0.11.1"
5 CATEGORY="network"
6 SHORT_DESC="Client for the BoxBackup on-line backup system"
7 MAINTAINER="domcox@slitaz.org"
8 DEPENDS="db libedit libssl perl zlib gcc-lib-base"
9 SOURCE="boxbackup"
10 WANTED="boxbackup-server"
11 WEB_SITE="http://www.boxbackup.org/"
12 TAGS="backup automatic client"
14 # Configuration variables
15 CONF_DIR="/etc/boxbackup"
16 DATA_DIR="/var/lib/bbackupd"
17 RUN_DMON=0
19 # Rules to gen a SliTaz package suitable for Tazpkg
20 genpkg_rules()
21 {
22 mkdir -p $fs/usr/bin
23 cp -a $_pkg/boxbackup-${VERSION}-backup-client-linux-gnu/bb* $fs/usr/bin
24 rm -f $fs/usr/bin/*.*
25 mkdir -p $fs/etc/init.d
26 cp -a $stuff/bbackupd $fs/etc/init.d
27 }
29 # Pre and post install commands for Tazpkg
31 pre_install()
32 {
33 # Stop daemon
34 if [ -e /var/run/bbackupd.pid ]; then
35 /etc/init.d/bbackupd stop
36 RUN_DMON=1
37 fi
38 }
40 post_install()
41 {
42 # Creating conf dir
43 if [ ! -e $1/$CONF_DIR ]; then
44 mkdir -p $1/$CONF_DIR && chmod 755 $1/$CONF_DIR
45 fi
46 if [ ! -e $1/$DATA_DIR ]; then
47 mkdir -p $1/$DATA_DIR && chmod 700 $1/$DATA_DIR
48 fi
49 if [ -z $1 ]; then
50 # Start daemon (if stopped by install)
51 if [ $RUN_DMON -eq 1 ]; then
52 /etc/init.d/bbackupd start
53 fi
54 fi
55 }
57 # Pre and post remove commands for Tazpkg
59 pre_remove()
60 {
61 # Stop daemon
62 if [ -z $1 ]; then
63 if [ -e /var/run/bbackupd.pid ]; then
64 /etc/init.d/bbackupd stop
65 fi
66 fi
67 }
69 post_remove()
70 {
71 # Delete DATA directory
72 rm -rf $1/$DATA_DIR
74 # Delete Client config files
75 rm -rf $1/$CONF_DIR/bbackupd*
77 # Delete CONF dir (if empty)
78 if [ $(ls -lA $CONF_DIR | wc -l) -eq 0 ]; then
79 echo -n "Removing $CONF_DIR..."
80 rm -rf $1/$CONF_DIR
81 status
82 fi
83 # Delete PID, sock files
84 rm -f $1/var/run/bbackupd.*
85 }