22
22
23
23
set -e
24
24
25
- os_name=` (grep -o ' ^NAME=.*' /etc/os-release | cut -f2 -d\" | sed ' s/"//g' )`
26
- os_version=` (grep -o ' ^VERSION_ID=.*' /etc/os-release | cut -f2 -d\" | sed ' s/"//g' )`
25
+ os_name=$ ( grep -o ' ^NAME=.*' /etc/os-release | cut -f2 -d\" | sed ' s/"//g' )
26
+ os_version=$ ( grep -o ' ^VERSION_ID=.*' /etc/os-release | cut -f2 -d\" | sed ' s/"//g' )
27
27
echo " Platform is ${os_name} , Version: ${os_version} "
28
+ git_root=$( pwd)
28
29
29
30
# mbedtls-dev:
31
+ cd ${git_root}
32
+ mbetls_version=' 2.28.7'
30
33
if [[ $os_name == * " Red Hat" * || $os_name == * " CentOS" * ]]; then
31
34
echo " RHEL/CentOS platform is not currently supported by this plugin."
32
35
exit 1
33
36
else
34
- sudo apt-get install -y libmbedtls-dev
37
+ rm -rf v${mbetls_version} .tar.gz mbedtls-${mbetls_version}
38
+ wget " https://github.com/Mbed-TLS/mbedtls/archive/v${mbetls_version} .tar.gz"
39
+ tar xzvf v${mbetls_version} .tar.gz
40
+ cd mbedtls-${mbetls_version}
41
+ mkdir build
42
+ cd build
43
+ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DUSE_SHARED_MBEDTLS_LIBRARY=OFF ..
44
+ make
45
+ sudo make install
35
46
fi
36
47
37
48
# libexpat:
49
+ cd ${git_root}
50
+ libexpat_version=" 2.6.0"
51
+ libexpat_branch=" R_${libexpat_version// ./ _} "
38
52
rm -rf libexpat
39
- echo " Fetching an Expat, a C library for parsing XML..."
40
- git clone https://github.com/libexpat/libexpat.git
53
+ git clone https://github.com/libexpat/libexpat.git --branch ${libexpat_branch} --depth 1
41
54
(
42
55
cd libexpat/expat
43
56
./buildconf.sh && \
@@ -47,34 +60,34 @@ git clone https://github.com/libexpat/libexpat.git
47
60
)
48
61
49
62
# libcheck:
50
- rm -rf check-0.15.2 check-0.15.2.tar.gz*
51
- wget https://github.com/libcheck/check/releases/download/0.15.2/check-0.15.2.tar.gz
52
- tar xf check-0.15.2.tar.gz
63
+ cd ${git_root}
64
+ lib_check_version=" 0.15.2"
65
+ rm -rf check-${lib_check_version} .tar.gz check-${lib_check_version}
66
+ wget https://github.com/libcheck/check/releases/download/${lib_check_version} /check-${lib_check_version} .tar.gz
67
+ tar xf check-${lib_check_version} .tar.gz
53
68
(
54
- cd check-0.15.2
55
- cp .. /scripts/s2opcua/check-0.15.2_CMakeLists .txt.patch .
56
- patch < check-0.15.2_CMakeLists .txt.patch # update the CMakeLists.txt file
69
+ cd check-${lib_check_version}
70
+ cp ${git_root} /scripts/s2opcua/check-${lib_check_version} _CMakeLists .txt.patch .
71
+ patch < check-${lib_check_version} _CMakeLists .txt.patch # update the CMakeLists.txt file
57
72
rm -f CMakeCache.txt
58
73
mkdir -p build
59
74
cd build
60
75
cmake .. && make -j4 && sudo make install
61
76
)
62
77
63
- # S2OPC:
78
+ # S2OPC
79
+ cd ${git_root}
80
+ s2opc_toolkit_version=" 1.5.0"
64
81
rm -rf S2OPC
65
- echo " Fetching S2OPC OPC UA Toolkit libraries..."
66
- git clone --depth 1 -b S2OPC_Toolkit_1.4.1 https://gitlab.com/systerel/S2OPC.git
67
-
82
+ git clone https://gitlab.com/systerel/S2OPC.git --branch S2OPC_Toolkit_${s2opc_toolkit_version} --depth 1
68
83
(
69
84
cd S2OPC
70
- cp ../scripts/s2opcua/S2OPC.patch .
71
- git apply S2OPC.patch
72
- BUILD_SHARED_LIBS=OFF
73
- CMAKE_INSTALL_PREFIX=/usr/local
74
- ./build.sh
85
+ BUILD_SHARED_LIBS=1 CMAKE_INSTALL_PREFIX=/usr/local ./build.sh
75
86
echo
76
87
echo " BUILD done, INSTALLING..."
77
88
echo
78
89
cd build
79
90
sudo make install
91
+ sudo cp ../src/ClientServer/frontend/client_wrapper/libs2opc_client_config_custom.h /usr/local/include/s2opc/clientserver
80
92
)
93
+
0 commit comments