File libArcus.spec of Package libArcus

#
# spec file for package libArcus
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define sover 3
Name:           libArcus
Version:        4.8.0
Release:        0
Summary:        3D printer control software
License:        LGPL-3.0-only
Group:          Development/Libraries/C and C++
URL:            https://github.com/Ultimaker/%name
Source:         %{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE - set a soname
Patch0:         set-soname.patch
# PATCH-FIX-OPENSUSE - get cmake working
Patch1:         fix-build.patch
BuildRequires:  cmake >= 3.6
BuildRequires:  gcc-c++
BuildRequires:  protobuf-devel >= 3.0.0
%if 0%{?suse_version} >= 1550
BuildRequires:  python310-sip6-devel
%else
BuildRequires:  python3-sip
%endif

%description
Communication library between internal components for Ultimaker software

%package -n %name%{sover}
Summary:        3D printer control software
# The forked libArcus-lulzbot uses the same SONAME ...
Group:          System/Libraries
Provides:       libArcus-Ultimaker

%description -n %name%{sover}
Communication library between internal components for Ultimaker software

%package devel
Summary:        Header files for libArcus
Group:          Development/Libraries/C and C++
Requires:       libArcus%{sover} = %{version}
Requires:       protobuf-devel >= 3.0.0
Requires:       python3-sip-devel

%description devel
The %{name}-devel package includes the header files, libraries and development
tools necessary for compiling and linking programs which use %{name}.

%prep
%setup -n %{name}-%{version}
%patch0 -p1
%patch1 -p1

%build
%cmake -DPython_VERSION=`python3.10 --version | cut -d\  -f 2`

%cmake_build

%install
#cmake_install is broken atm
mkdir -p %buildroot/%_libdir
mkdir -p %buildroot/%_includedir
cp -a build/libArcus.so* %buildroot/%_libdir/
cp -a include/* %buildroot/%_includedir

%post   -n %name%{sover} -p /sbin/ldconfig

%postun -n %name%{sover} -p /sbin/ldconfig

%files devel
%{_includedir}/Arcus
#%{_libdir}/cmake/Arcus
%{_libdir}/libArcus.so

%files -n %name%{sover}
%license LICENSE
%doc README.md
%{_libdir}/libArcus.so.*

openSUSE Build Service is sponsored by