wok view boxbackup-client/receipt @ rev 18490

Up cookutils (766)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 10 18:59:58 2015 +0200 (2015-10-10)
parents e7e64bbf2386
children fca172c323cf
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 LICENSE="GPL2"
9 SOURCE="boxbackup"
10 WANTED="boxbackup-server"
11 WEB_SITE="http://www.boxbackup.org/"
12 TAGS="backup automatic client"
14 DEPENDS="db libedit libssl perl zlib gcc-lib-base"
16 # Configuration variables
17 CONF_DIR="/etc/boxbackup"
18 DATA_DIR="/var/lib/bbackupd"
19 RUN_DMON=0
21 # Rules to gen a SliTaz package suitable for Tazpkg
22 genpkg_rules()
23 {
24 mkdir -p $fs/usr/bin
25 cp -a $install/boxbackup-${VERSION}-backup-client-linux-gnu/bb* $fs/usr/bin
26 rm -f $fs/usr/bin/*.*
27 mkdir -p $fs/etc/init.d
28 cp -a $stuff/bbackupd $fs/etc/init.d
29 }
31 # Pre and post install commands for Tazpkg
33 pre_install()
34 {
35 # Stop daemon
36 if [ -e /var/run/bbackupd.pid ]; then
37 /etc/init.d/bbackupd stop
38 RUN_DMON=1
39 fi
40 }
42 post_install()
43 {
44 # Creating conf dir
45 if [ ! -e $1/$CONF_DIR ]; then
46 mkdir -p $1/$CONF_DIR && chmod 755 $1/$CONF_DIR
47 fi
48 if [ ! -e $1/$DATA_DIR ]; then
49 mkdir -p $1/$DATA_DIR && chmod 700 $1/$DATA_DIR
50 fi
51 if [ -z $1 ]; then
52 # Start daemon (if stopped by install)
53 if [ $RUN_DMON -eq 1 ]; then
54 /etc/init.d/bbackupd start
55 fi
56 fi
57 }
59 # Pre and post remove commands for Tazpkg
61 pre_remove()
62 {
63 # Stop daemon
64 if [ -z $1 ]; then
65 if [ -e /var/run/bbackupd.pid ]; then
66 /etc/init.d/bbackupd stop
67 fi
68 fi
69 }
71 post_remove()
72 {
73 # Delete DATA directory
74 rm -rf $1/$DATA_DIR
76 # Delete Client config files
77 rm -rf $1/$CONF_DIR/bbackupd*
79 # Delete CONF dir (if empty)
80 if [ $(ls -lA $CONF_DIR | wc -l) -eq 0 ]; then
81 echo -n "Removing $CONF_DIR..."
82 rm -rf $1/$CONF_DIR
83 status
84 fi
85 # Delete PID, sock files
86 rm -f $1/var/run/bbackupd.*
87 }