]> git.pld-linux.org Git - packages/open62541.git/blob - open62541.spec
- updated to 1.3.3 (still uses deprecated libbpf API)
[packages/open62541.git] / open62541.spec
1 # TODO: MQTT
2 #
3 # Conditional build:
4 %bcond_without  apidocs         # API documentation
5 #
6 Summary:        Open source C implementation of OPC UA
7 Summary(pl.UTF-8):      Mająca otwarte źródła, napisana w C implementacja OPC UA
8 Name:           open62541
9 Version:        1.3.3
10 Release:        1
11 License:        MPL v2.0
12 Group:          Libraries
13 #Source0Download: https://github.com/open62541/open62541/releases
14 Source0:        https://github.com/open62541/open62541/archive/v%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5:  5a0ad259c1239221dea21e33815284d6
16 Patch0:         %{name}-types.patch
17 Patch1:         %{name}-bpf.patch
18 Patch2:         %{name}-libwebsockets4.patch
19 Patch3:         %{name}-visibility.patch
20 Patch4:         %{name}-rpath.patch
21 URL:            http://www.open62541.org/
22 BuildRequires:  cmake >= 3.0
23 BuildRequires:  libwebsockets-devel
24 BuildRequires:  openssl-devel
25 BuildRequires:  p11-kit-devel
26 BuildRequires:  python3 >= 1:3
27 BuildRequires:  tpm2-pkcs11-devel
28 %if %{with apidocs}
29 BuildRequires:  python3-sphinx_rtd_theme
30 BuildRequires:  sphinx-pdg >= 2
31 %endif
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 open62541 is an open source and free implementation of OPC UA (OPC
36 Unified Architecture) written in the common subset of the C99 and
37 C++98 languages. The library is usable with all major compilers and
38 provides the necessary tools to implement dedicated OPC UA clients and
39 servers, or to integrate OPC UA-based communication into existing
40 applications. open62541 library is platform independent. All
41 platform-specific functionality is implemented via exchangeable
42 plugins. Plugin implementations are provided for the major operating
43 systems.
44
45 %description -l pl.UTF-8
46 open62541 to wolnodostępna, otwarta implementacja OPC UA (OPC Unified
47 Architecture), napisana we wspólnym podzbiorze języków C99 i C++98.
48 Biblioteka jest używalna ze wszystkimi głównymi kompilatorami,
49 dostarcza narzędzia potrzebne do implementacji dedykowanych klientów i
50 serwerów OPC UA lub integracji komunikacji opartej o OPC UA w
51 istniejących aplikacjach. Biblioteka open62541 jest niezależna od
52 platformy. Zała funkcjonalność zależna od platformy jest
53 implementowana poprzez wymienne wtyczki. Implementacje wtyczek dla
54 wszystkich głównych systemów są dostarczone.
55
56 %package devel
57 Summary:        Header files for open62541 library
58 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki open62541
59 Group:          Development/Libraries
60 Requires:       %{name} = %{version}-%{release}
61
62 %description devel
63 Header files for open62541 library.
64
65 %description devel -l pl.UTF-8
66 Pliki nagłówkowe biblioteki open62541.
67
68 %package apidocs
69 Summary:        API documentation for open62541 library
70 Summary(pl.UTF-8):      Dokumentacja API biblioteki open62541
71 Group:          Documentation
72 BuildArch:      noarch
73
74 %description apidocs
75 API documentation for open62541 library.
76
77 %description apidocs -l pl.UTF-8
78 Dokumentacja API biblioteki open62541.
79
80 %prep
81 %setup -q
82 %patch0 -p1
83 %patch1 -p1
84 %patch2 -p1
85 %patch3 -p1
86 %patch4 -p1
87
88 # not for gcc
89 %{__sed} -i -e '/check_add_.*-Wno-static-in-inline/d' CMakeLists.txt
90
91 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' \
92         tools/*.py \
93         tools/nodeset_compiler/nodeset_testing.py
94
95 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' \
96         tools/certs/create_self-signed.py \
97         tools/nodeset_compiler/nodeset_compiler.py
98
99 # not executable directly, drop shebangs
100 %{__sed} -i -e '1s,.*/usr/bin/env python.*,,' \
101         tools/nodeset_compiler/{backend_open62541,backend_open62541_nodes,datatypes,nodes,nodeset}.py
102
103 %build
104 install -d build
105 cd build
106 # tpm2 support needs pkcs11.h from tpm2-pkcs11, which is in fast p11-kit include file
107 CFLAGS="%{rpmcflags} -I/usr/include/p11-kit-1/p11-kit -Wno-error=maybe-uninitialized"
108 LDFLAGS="%{rpmldflags} -L%{_libdir}/pkcs11"
109 %cmake .. \
110         -DCMAKE_INSTALL_INCLUDEDIR=include \
111         -DCMAKE_INSTALL_LIBDIR=%{_lib} \
112         -DTPM2_LIB=%{_libdir}/pkcs11/libtpm2_pkcs11.so \
113         -DUA_BUILD_TOOLS=ON \
114         -DUA_ENABLE_DISCOVERY=ON \
115         -DUA_ENABLE_ENCRYPTION=MBEDTLS \
116         -DUA_ENABLE_ENCRYPTION_TPM2=ON \
117         -DUA_ENABLE_JSON_ENCODING=ON \
118         -DUA_ENABLE_PUBSUB=ON \
119         -DUA_ENABLE_PUBSUB_ENCRYPTION=ON \
120         -DUA_ENABLE_PUBSUB_ETH_UADP=ON \
121         -DUA_ENABLE_WEBSOCKET_SERVER=ON \
122         -DUA_MULTITHREADING=100
123
124 # -DUA_ENABLE_DISCOVERY_MULTICAST=ON requires deps/mdnsd
125 # -DUA_ENABLE_PUBSUB_MQTT requires deps/mqtt-c
126 # -DUA_NAMESPACE_ZERO=FULL requires deps/ua_nodeset
127
128 %{__make}
129
130 %if %{with apidocs}
131 %{__make} doc
132 %endif
133
134 %install
135 rm -rf $RPM_BUILD_ROOT
136
137 %{__make} -C build install \
138         DESTDIR=$RPM_BUILD_ROOT
139
140 # tests
141 %{__rm} $RPM_BUILD_ROOT%{_datadir}/open62541/tools/nodeset_compiler/nodeset_testing.py
142
143 %clean
144 rm -rf $RPM_BUILD_ROOT
145
146 %post   -p /sbin/ldconfig
147 %postun -p /sbin/ldconfig
148
149 %files
150 %defattr(644,root,root,755)
151 %doc AUTHORS CHANGELOG FEATURES.md README.md
152 %attr(755,root,root) %{_libdir}/libopen62541.so.*.*.*
153 %attr(755,root,root) %ghost %{_libdir}/libopen62541.so.1
154 %dir %{_datadir}/open62541
155 %dir %{_datadir}/open62541/tools
156 %attr(755,root,root) %{_datadir}/open62541/tools/generate_*.py
157 %dir %{_datadir}/open62541/tools/certs
158 %attr(755,root,root) %{_datadir}/open62541/tools/certs/create_self-signed.py
159 %{_datadir}/open62541/tools/certs/localhost.cnf
160 %dir %{_datadir}/open62541/tools/nodeset_compiler
161 %attr(755,root,root) %{_datadir}/open62541/tools/nodeset_compiler/nodeset_compiler.py
162 %{_datadir}/open62541/tools/nodeset_compiler/[!n]*.py
163 %{_datadir}/open62541/tools/nodeset_compiler/nodes.py
164 %{_datadir}/open62541/tools/nodeset_compiler/nodeset.py
165 %{_datadir}/open62541/tools/nodeset_compiler/__pycache__
166 %{_datadir}/open62541/tools/nodeset_compiler/NodeID_NS0_Base.txt
167 %doc %{_datadir}/open62541/tools/nodeset_compiler/README.md
168 %{_datadir}/open62541/tools/schema
169
170 %files devel
171 %defattr(644,root,root,755)
172 %attr(755,root,root) %{_libdir}/libopen62541.so
173 %{_includedir}/open62541
174 %{_includedir}/aa_tree.h
175 %{_includedir}/ms_stdint.h
176 %{_includedir}/ziptree.h
177 %{_pkgconfigdir}/open62541.pc
178 %{_libdir}/cmake/open62541
179
180 %if %{with apidocs}
181 %files apidocs
182 %defattr(644,root,root,755)
183 %doc build/doc/{_images,_static,*.html,*.js}
184 %endif
This page took 0.086262 seconds and 3 git commands to generate.