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