Blame view

compilAndInstall.sh 1.95 KB
4cedf03b   Benjamin Renard   Update script use...
1
2
3
4
5
6
7
#!/bin/sh

usage="
    \n ### Install ddserver###
    \n
    \n    Usage : $0 -d <Destination path> -u <DDService URL> -r <DD.res directory path> -b <DDBASE path> [-l <User local directory. By default, it's /usr/local>] [-p <Proxy host:port>] [-a <Proxy user name:password for authentication>]
    \n
ef6a3cfa   Benjamin Renard   Add DDadmin compi...
8
    \n            $0 -d /opt/tools/DDServer -u http://amdadev.fr/DDService -r /var/amda-data/ -b /var/amda-data/DDBASE -l /opt/local -p 'myproxy.fr:9090' -a 'username:userpwd'
4cedf03b   Benjamin Renard   Update script use...
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
73
74
75
76
77
78
    \n
    \n
    \n ###"

USERLOCAL_ROOT='/usr/lib'

while getopts "d:u:r:b:l:p:a:h" options; do
    case $options in
        d ) INSTALL_DIR=`echo $OPTARG`;;
        u ) DDSERVICE_URL=`echo $OPTARG`;;
        r ) DDRESPATH=`echo $OPTARG`;;
        b ) DDBASEPATH=`echo $OPTARG`;;
        l ) USERLOCAL_ROOT=`echo $OPTARG`;;
        p ) PROXY_HOST=`echo $OPTARG`;;
        a ) PROXY_USERPWD=`echo $OPTARG`;;
        h ) echo -e $usage
            exit 1;;
        \? ) echo -e $usage
            exit 1;;
        * ) echo -e $usage
            exit 1;;
    esac
done

if [ "$INSTALL_DIR" = "" ]
then
    echo "[ERROR] Missing INSTALL_DIR definition"
    echo -e $usage
    exit 1
fi

if [ "$DDSERVICE_URL" = "" ]
then
    echo "[ERROR] Missing DDSERVICE_URL definition"
    echo -e $usage
    exit 1
fi

if [ "$DDBASEPATH" = "" ]
then
    echo "[ERROR] Missing DDBASE definition"
    echo -e $usage
    exit 1
fi

if [ "$DDRESPATH" = "" ]
then
    echo "[ERROR] Missing DDBASE definition"
    echo -e $usage
    exit 1
fi

export INSTALL_DIR DDSERVICE_URL DDRESPATH DDBASEPATH USERLOCAL_ROOT PROXY_HOST PROXY_USERPWD

cmake -E make_directory build
if [[ $? != 0 ]]; then exit 1; fi

cmake -E chdir build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
if [[ $? != 0 ]]; then exit 1; fi

cmake --build build
if [[ $? != 0 ]]; then exit 1; fi

sudo make -C build install VERBOSE=1
if [[ $? != 0 ]]; then exit 1; fi

# Post install
sudo ln -s ${DDBASEPATH} ${INSTALL_DIR}/DDService/BASE

exit 0