aboutsummaryrefslogtreecommitdiffstats
path: root/databases/frontbase/pkg-install
blob: ebf3a1055471cede280b01c3d36114f5d11c6bf3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#! /bin/sh

# $FreeBSD$

PATH=/bin:/usr/sbin:/usr/bin
FBUSER=frontbase
DB_DIR=${PKG_PREFIX}/FrontBase/Databases

backupwarning() { echo "

  =========== BACKUP YOUR DATA! =============
  As always, backup your data before
  upgrading. This is *NOT* done by the port!

  Press ctrl-C *now* if you need to backup.
  ===========================================
"
    sleep 5
}

licensestring() { echo "
  You will need to obtain and install a valid license string.
  Go to http://www.frontbase.com and request a license

  Once you have obtained a valid license string, install it as follows:

    Create a file ${PKG_PREFIX}/FrontBase/LicenseString with a single line
    consisting of the 64-character license string, followed by a colon (:)
    and the 16-character license check, i.e. a total of 81 characters.

  Once the license file has been installed, restart FrontBase.

  To verify that the license string has been installed correctly, 
  run ${PKG_PREFIX}/FrontBase/bin/FBInfoCenter
"
}


pre-install() {
    backupwarning
}

post-install() {
    mkdir -p ${PKG_PREFIX}/FrontBase/Backups
    mkdir -p ${PKG_PREFIX}/FrontBase/Databases
    mkdir -p ${PKG_PREFIX}/FrontBase/TransactionLogs
    chmod 750 ${PKG_PREFIX}/FrontBase/Backups
    chmod 750 ${PKG_PREFIX}/FrontBase/Databases
    chmod 750 ${PKG_PREFIX}/FrontBase/TransactionLogs
    chown -R frontbase:wheel ${PKG_PREFIX}/FrontBase/Backups \
        ${PKG_PREFIX}/FrontBase/Databases \
        ${PKG_PREFIX}/FrontBase/TransactionLogs
    licensestring
}

case $2 in
PRE-INSTALL)
    pre-install
    exit 0
    ;;
POST-INSTALL)
    post-install
    exit 0
    ;;
BACKUPWARNING)
    backupwarning
    exit 0
    ;;
*)
    exit 1
    ;;
esac