Skip to content

Commit 12d375b

Browse files
committed
S2OPCUA new tooolkit version
Signed-off-by: ashish-jabble <[email protected]>
1 parent 69be039 commit 12d375b

File tree

3 files changed

+37
-157
lines changed

3 files changed

+37
-157
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ others/jansson
1616
others/lib60870
1717
others/libiec61850
1818
others/S2OPC
19-
others/check-0.15.2.tar.gz
20-
others/check-0.15.2
2119
others/libexpat
20+
others/check-0.15.2
21+
others/mbedtls-2.28.7
22+
others/*.tar.gz
2223
others/scripts/mqtt/paho.mqtt.c*
2324

2425
# Archived packages

others/scripts/s2opcua/S2OPC.patch

Lines changed: 0 additions & 130 deletions
This file was deleted.

others/scripts/s2opcua/requirements.sh

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,59 +22,68 @@
2222

2323
set -e
2424

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')
2727
echo "Platform is ${os_name}, Version: ${os_version}"
2828

2929
# mbedtls-dev:
30+
mbetls_version='2.28.7'
3031
if [[ $os_name == *"Red Hat"* || $os_name == *"CentOS"* ]]; then
3132
echo "RHEL/CentOS platform is not currently supported by this plugin."
3233
exit 1
3334
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
3544
fi
3645

3746
# 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
4151
(
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
4657
sudo make install
4758
)
4859

4960
# 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
5365
(
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
5769
rm -f CMakeCache.txt
5870
mkdir -p build
5971
cd build
6072
cmake .. && make -j4 && sudo make install
6173
)
6274

63-
# S2OPC:
75+
# S2OPC
76+
s2opc_toolkit_version="1.5.0"
6477
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
6879
(
6980
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
7582
echo
7683
echo "BUILD done, INSTALLING..."
7784
echo
7885
cd build
7986
sudo make install
87+
sudo cp ../src/ClientServer/frontend/client_wrapper/libs2opc_client_config_custom.h /usr/local/include/s2opc/clientserver
8088
)
89+

0 commit comments

Comments
 (0)