|
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:
|
38 |
| -rm -rf libexpat |
39 |
| -echo "Fetching an Expat, a C library for parsing XML..." |
40 |
| -git clone https://github.com/libexpat/libexpat.git |
| 49 | +cd ${git_root} |
| 50 | +libexpat_version="2.6.0" |
| 51 | +rm -rf expat-${libexpat_version}.tar.gz expat-${libexpat_version} |
| 52 | +wget https://github.com/libexpat/libexpat/releases/download/R_2_6_0/expat-${libexpat_version}.tar.gz |
| 53 | +tar xzvf expat-${libexpat_version}.tar.gz |
41 | 54 | (
|
42 |
| - cd libexpat/expat |
43 |
| - ./buildconf.sh && \ |
44 |
| - ./configure && \ |
45 |
| - make && \ |
| 55 | + cd expat-${libexpat_version} |
| 56 | + mkdir build |
| 57 | + cd build |
| 58 | + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DEXPAT_SHARED_LIBS=ON .. |
| 59 | + make |
46 | 60 | sudo make install
|
47 | 61 | )
|
48 | 62 |
|
49 | 63 | # 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 |
| 64 | +cd ${git_root} |
| 65 | +lib_check_version="0.15.2" |
| 66 | +rm -rf check-${lib_check_version}.tar.gz check-${lib_check_version} |
| 67 | +wget https://github.com/libcheck/check/releases/download/${lib_check_version}/check-${lib_check_version}.tar.gz |
| 68 | +tar xf check-${lib_check_version}.tar.gz |
53 | 69 | (
|
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 |
| 70 | + cd check-${lib_check_version} |
| 71 | + cp ${git_root}/scripts/s2opcua/check-${lib_check_version}_CMakeLists.txt.patch . |
| 72 | + patch < check-${lib_check_version}_CMakeLists.txt.patch # update the CMakeLists.txt file |
57 | 73 | rm -f CMakeCache.txt
|
58 | 74 | mkdir -p build
|
59 | 75 | cd build
|
60 | 76 | cmake .. && make -j4 && sudo make install
|
61 | 77 | )
|
62 | 78 |
|
63 |
| -# S2OPC: |
| 79 | +# S2OPC |
| 80 | +cd ${git_root} |
| 81 | +s2opc_toolkit_version="1.5.0" |
64 | 82 | 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 |
| - |
| 83 | +git clone https://gitlab.com/systerel/S2OPC.git --branch S2OPC_Toolkit_${s2opc_toolkit_version} --depth 1 |
68 | 84 | (
|
69 | 85 | 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 |
| 86 | + BUILD_SHARED_LIBS=1 CMAKE_INSTALL_PREFIX=/usr/local ./build.sh |
75 | 87 | echo
|
76 | 88 | echo "BUILD done, INSTALLING..."
|
77 | 89 | echo
|
78 | 90 | cd build
|
79 | 91 | sudo make install
|
| 92 | + sudo cp ../src/ClientServer/frontend/client_wrapper/libs2opc_client_config_custom.h /usr/local/include/s2opc/clientserver |
80 | 93 | )
|
| 94 | + |
0 commit comments