|
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 | 28 |
|
29 | 29 | # mbedtls-dev:
|
| 30 | +mbetls_version='2.28.7' |
30 | 31 | if [[ $os_name == *"Red Hat"* || $os_name == *"CentOS"* ]]; then
|
31 | 32 | echo "RHEL/CentOS platform is not currently supported by this plugin."
|
32 | 33 | exit 1
|
33 | 34 | else
|
34 |
| - sudo apt-get install -y libmbedtls-dev |
| 35 | + rm -rf v${mbetls_version}.tar.gz mbedtls-${mbetls_version} |
| 36 | + wget "https://github.com/Mbed-TLS/mbedtls/archive/v${mbetls_version}.tar.gz" |
| 37 | + tar xzvf v${mbetls_version}.tar.gz |
| 38 | + cd mbedtls-${mbetls_version} |
| 39 | + mkdir build |
| 40 | + cd build |
| 41 | + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DUSE_SHARED_MBEDTLS_LIBRARY=OFF .. |
| 42 | + make |
| 43 | + sudo make install |
35 | 44 | fi
|
36 | 45 |
|
37 | 46 | # libexpat:
|
38 |
| -rm -rf libexpat |
39 |
| -echo "Fetching an Expat, a C library for parsing XML..." |
40 |
| -git clone https://github.com/libexpat/libexpat.git |
| 47 | +libexpat_version="2.6.0" |
| 48 | +rm -rf expat-${libexpat_version}.tar.gz expat-${libexpat_version} |
| 49 | +wget https://github.com/libexpat/libexpat/releases/download/R_2_6_0/expat-${libexpat_version}.tar.gz |
| 50 | +tar xzvf expat-${libexpat_version}.tar.gz |
41 | 51 | (
|
42 |
| - cd libexpat/expat |
43 |
| - ./buildconf.sh && \ |
44 |
| - ./configure && \ |
45 |
| - make && \ |
| 52 | + cd expat-${libexpat_version} |
| 53 | + mkdir build |
| 54 | + cd build |
| 55 | + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DEXPAT_SHARED_LIBS=OFF .. |
| 56 | + make |
46 | 57 | sudo make install
|
47 | 58 | )
|
48 | 59 |
|
49 | 60 | # 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 |
| 61 | +lib_check_version="0.15.2" |
| 62 | +rm -rf check-${lib_check_version}.tar.gz check-${lib_check_version} |
| 63 | +wget https://github.com/libcheck/check/releases/download/${lib_check_version}/check-${lib_check_version}.tar.gz |
| 64 | +tar xf check-${lib_check_version}.tar.gz |
53 | 65 | (
|
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 |
| 66 | + cd check-${lib_check_version} |
| 67 | + cp ../../../scripts/s2opcua/check-${lib_check_version}_CMakeLists.txt.patch . |
| 68 | + patch < check-${lib_check_version}_CMakeLists.txt.patch # update the CMakeLists.txt file |
57 | 69 | rm -f CMakeCache.txt
|
58 | 70 | mkdir -p build
|
59 | 71 | cd build
|
60 | 72 | cmake .. && make -j4 && sudo make install
|
61 | 73 | )
|
62 | 74 |
|
63 |
| -# S2OPC: |
| 75 | +# S2OPC |
| 76 | +s2opc_toolkit_version="1.5.0" |
64 | 77 | 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 |
| - |
| 78 | +git clone https://gitlab.com/systerel/S2OPC.git --branch S2OPC_Toolkit_${s2opc_toolkit_version} --depth 1 |
68 | 79 | (
|
69 | 80 | 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 |
| 81 | + BUILD_SHARED_LIBS=1 CMAKE_INSTALL_PREFIX=/usr/local ./build.sh |
75 | 82 | echo
|
76 | 83 | echo "BUILD done, INSTALLING..."
|
77 | 84 | echo
|
78 | 85 | cd build
|
79 | 86 | sudo make install
|
| 87 | + sudo cp ../src/ClientServer/frontend/client_wrapper/libs2opc_client_config_custom.h /usr/local/include/s2opc/clientserver |
80 | 88 | )
|
| 89 | + |
0 commit comments