Name: open62541
Version: 1.2.2
Release: 1
Summary: OPC UA implementation
License: MPLv2.0
URL: http://open62541.org
Source0: https://github.com/open62541/open62541/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc-c++
BuildRequires: cmake3
BuildRequires: make
BuildRequires: python3
BuildRequires: python3dist(six)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-rtd-theme)
BuildRequires: graphviz
%description
open62541 is a C-based library (linking with C++ projects is possible)
with all necessary tools to implement dedicated OPC UA clients and servers,
or to integrate OPC UA-based communication into existing applications.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
The %{name}-doc package contains documentation for %{name}.
%prep
%autosetup -n %{name}-%{version}
%build
mkdir -p build
cd build
%cmake3 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS="-Wno-error=cast-function-type -Wno-stringop-overflow" \
-DOPEN62541_VERSION=v%{version} \
-DUA_ENABLE_AMALGAMATION=ON ..
%make_build
%make_build doc
%install
mkdir stage-docs
cd build
%make_install
rm -rf doc/CMakeFiles doc/Makefile doc/*.cmake
cp -av doc/* ../stage-docs/
cd -
rm examples/CMakeLists.txt
rm -Rf %{buildroot}/usr/share/open62541/tools
chmod 0644 examples/nodeset/Opc.Ua.POWERLINK.NodeSet2.bsd
%ldconfig_scriptlets
%files
%license LICENSE
%doc AUTHORS README.md
%{_libdir}/libopen62541.so.1*
%files devel
%license LICENSE LICENSE-CC0
%doc FEATURES.md
%{_libdir}/libopen62541.so
%{_libdir}/pkgconfig/open62541.pc
%{_includedir}/open62541.h
%{_libdir}/cmake/open62541*
%files doc
%doc stage-docs/*
%doc examples/
%changelog
* Thu Nov 23 2023 wulei <wu_lei@hoperun.com> - 1.2.2-1
- Initial package