A new user interface for you! Read more...

File open62541.spec of Package open62541

%define soversion 0

Name:     open62541
Version:  0.4-dev
Release:  0
Summary:  OPC UA implementation
License:  MPL-2.0
URL:      http://open62541.org
Group:    Productivity/Networking/Other
Source:   %{name}-%{version}.tar.xz

BuildRequires:  pkgconfig
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  mbedtls-devel
%if 0%{?suse_version} > 1320
BuildRequires:  python3
BuildRequires:  python3-base
BuildRequires:  python3-six
%else
BuildRequires:  python
BuildRequires:  python-base
BuildRequires:  python-six
BuildRequires:  python-xml
%endif

%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  -n libopen62541-%{soversion}
Summary:  OPC UA implementation
Group:    Productivity/Networking/Other

%description -n libopen62541-%{soversion}
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}
Group:    Development/Libraries/Other
Requires: libopen62541-%{soversion} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q -n %{name}-%{version}

### -DUA_ENABLE_FULL_NS0=ON \
### -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
%build

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DBUILD_SHARED_LIBS=ON \
      -DUA_ENABLE_DISCOVERY=ON \
      -DUA_ENABLE_METHODCALLS=ON \
      -DUA_ENABLE_NODEMANAGEMENT=ON \
      -DUA_ENABLE_SUBSCRIPTIONS=ON \
      -DUA_ENABLE_DISCOVERY=ON \
      -DUA_ENABLE_PUBSUB=ON \
      -DUA_ENABLE_ENCRYPTION=ON \
      -DUA_ENABLE_MULTITHREADING=ON \
      -DUA_ENABLE_IMMUTABLE_NODES=ON \
      -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DLIB_INSTALL_DIR=%{_libdir} \
      .

make %{?_smp_mflags}

%install
%make_install

# Remove this from the examples installation
rm examples/CMakeLists.txt

%post   -n libopen62541-%{soversion} -p /sbin/ldconfig

%postun -n libopen62541-%{soversion} -p /sbin/ldconfig

%files -n libopen62541-%{soversion}
%license LICENSE
%doc AUTHORS CHANGELOG README.md
%{_libdir}/libopen62541.so.%{soversion}*

%files devel
%license LICENSE LICENSE-CC0
%{_libdir}/libopen62541.so
%{_libdir}/pkgconfig/open62541.pc
%dir %{_includedir}/open62541
%{_includedir}/open62541/*
%dir %{_libdir}/cmake/open62541
%{_libdir}/cmake/open62541/*.cmake
%dir %{_exec_prefix}/share/open62541
%{_exec_prefix}/share/open62541/*

%doc FEATURES.md
%doc examples/

%changelog