forked from hso-esk/opcua-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.check-dependencies
executable file
·166 lines (123 loc) · 2.51 KB
/
.check-dependencies
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#! /bin/bash
# @description : Checks for build dependencies (boost, openssl, odbc
# libs and submodules) before running a pipeline build.
# @returns : return code | description
# 0 | check successful
# 1 | boost binaries not found
# 2 | openssl binaries not found
# 3 | odbc binaries not found
# 4 | asneg submodule not initialized
# 5 | asneg-db-server submodule not initialized
# 6 | sensor descriptions submodule not initialized
# 7 | LwM2M server submodule not initialized
# 8 | LwM2M server interface submodule not initialized
# 9 | Helpers submodule not initialized
# @author : Dovydas Girdvainis
# @date : 2018-10-08
## Path definitions
BASE_DIR=../../
BOOST_VER=["1_54_0","1_67_0"]
BOOST_ARCH=["arm","x86-amd64"]
MIN_ARG_COUNT=1
usage () {
echo "-b | --boost specify the path to boost libs"
}
check_boost () {
i=0
returnCode=1
while [ $i -lt 2 ];
do
if [ -d "${BASE_DIR}boost-${BOOST_ARCH}_${BOOST_VER}" ];
then
returnCode=0
else
returnCode=1
fi
(( i++ ))
done
}
check_openssl () {
returnCode=2
if [ -d "${BASE_DIR}openssl/bin" ];
then
returnCode=0
fi
}
check_odbc () {
returnCode=3
if [ -d "${BASE_DIR}/odbc-arm/bin" ];
then
returnCode=0
fi
}
check_asneg_submodule () {
returnCode=4
if [ -d "./asneg/src" ];
then
returnCode=0
fi
}
check_asneg_db_submodule () {
returnCode=5
if [ -d "./asneg-db-server/OpcUaDB/src" ];
then
returnCode=0
fi
}
check_sensor_descriptions_submodule () {
returnCode=6
if [ -d "./cfg/etc/OpcUaStack/Nodes/sensor_xml_descriptions/ipso-descriptions" ];
then
returnCode=0
fi
}
check_lwm2m_server_submodule () {
returnCode=7
if [ -d "./opcua-plugin/opcua-lwm2m-server/wakaama" ];
then
returnCode=0
fi
}
check_lwm2m_server_interface_submodule () {
returnCode=8
if [ -f "./opcua-plugin/opcua-sensor-interface/CMakeLists.txt" ];
then
returnCode=0
fi
}
check_helpers_submodule () {
returnCode=9
if [ -d "opcua-plugin/gateway/helpers/gateway-installer" ];
then
returnCode=0
fi
}
if [ $# -lt $MIN_ARG_COUNT ];
then
usage
exit 0
fi
while [ -n "$1" ];
do
case $1 in
-b | --boost)
shift
if [ -n "$1" ];
then
BASE_DIR=$1
else
usage
fi
;;
esac
shift
done
check_boost
check_openssl
check_odbc
check_asneg_submodule
check_asneg_db_submodule
check_sensor_descriptions_submodule
check_lwm2m_server_submodule
check_lwm2m_server_interface_submodule
check_helpers_submodule