0705cb4
Name:           libsavitar
924468d
Version:        5.3.0
40a049c
Release:        %autorelease
0705cb4
Summary:        C++ implementation of 3mf loading with SIP Python bindings
0e61bff
License:        LGPL-3.0-or-later
0705cb4
URL:            https://github.com/Ultimaker/libSavitar
a047ac7
Source0:        %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
0e61bff
# Python bits
0e61bff
Source1:        https://github.com/Ultimaker/pySavitar/archive/%{version}.tar.gz#/pySavitar-%{version}.tar.gz
0705cb4
0e61bff
# Cmake bits taken from 4.13.1, before upstream went nuts with conan
0e61bff
Source2:        FindSIP.cmake
0e61bff
Source3:        SIPMacros.cmake
0e61bff
Source4:        CMakeLists.txt
0e61bff
Source5:        SavitarConfig.cmake.in
0e61bff
Source6:        COPYING-CMAKE-SCRIPTS
0e61bff
0e61bff
# Actually export symbols into the shared lib
0e61bff
Patch0:         libsavitar-5.2.2-export-fix.patch
0705cb4
0705cb4
BuildRequires:  cmake
0705cb4
BuildRequires:  dos2unix
0705cb4
BuildRequires:  gcc-c++
3c31beb
BuildRequires:  git-core
0705cb4
BuildRequires:  pugixml-devel
0705cb4
BuildRequires:  python3-devel
0705cb4
BuildRequires:  python3-sip-devel
0705cb4
BuildRequires:  /usr/bin/sip
0705cb4
0e61bff
# we add a dependency on setuptools to provide the distutils module for FindSIP.cmake
7386342
BuildRequires:  (python3-setuptools if python3-devel >= 3.12)
7386342
1be19f9
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
1be19f9
ExcludeArch:    %{ix86}
219ef48
0705cb4
%description
0705cb4
Savitar is a C++ implementation of 3mf loading with SIP Python bindings.
0705cb4
3mf is a 3D printing file format.
0705cb4
0705cb4
%package        devel
0705cb4
Summary:        Development files for libsavitar
0705cb4
Requires:       %{name}%{?_isa} = %{version}-%{release}
0e61bff
# The cmake scripts are BSD
0e61bff
License:        LGPL-3.0-or-later AND BSD-3-Clause
0705cb4
0705cb4
%description    devel
0705cb4
Savitar is a C++ implementation of 3mf loading with SIP Python bindings.
0705cb4
3mf is a 3D printing file format.
0705cb4
0705cb4
Development files.
0705cb4
0705cb4
%package -n     python3-savitar
0705cb4
Summary:        Python 3 libSavitar bindings
6345860
Requires:       %{name}%{?_isa} = %{version}-%{release}
0705cb4
0705cb4
%description -n python3-savitar
0705cb4
Savitar is a C++ implementation of 3mf loading with SIP Python bindings.
0705cb4
3mf is a 3D printing file format.
0705cb4
0705cb4
The Python bindings.
0705cb4
0705cb4
%prep
0e61bff
%autosetup -n libSavitar-%{version} -p1 -S git -a 1
0e61bff
0e61bff
cp -a pySavitar-%{version}/python .
0e61bff
mkdir cmake
0e61bff
cp -a %{SOURCE2} %{SOURCE3} %{SOURCE6} cmake/
0e61bff
rm -rf CMakeLists.txt
0e61bff
cp -a %{SOURCE4} %{SOURCE5} .
0705cb4
0705cb4
# Wrong end of line encoding
0705cb4
dos2unix README.md
0705cb4
0705cb4
%build
0705cb4
export CXXFLAGS="%{optflags} -Wl,--as-needed"
9e46ac6
%cmake -DCMAKE_SKIP_RPATH:BOOL=ON
219ef48
%cmake_build
0705cb4
0705cb4
%install
219ef48
%cmake_install
0705cb4
0705cb4
%files
0705cb4
%license LICENSE
0705cb4
%doc README.md
0705cb4
%{_libdir}/libSavitar.so.*
0705cb4
0705cb4
%files devel
0705cb4
%license LICENSE cmake/COPYING-CMAKE-SCRIPTS
0705cb4
%{_libdir}/libSavitar.so
0705cb4
%{_includedir}/Savitar
0705cb4
# Own the dir not to depend on cmake:
0705cb4
%{_libdir}/cmake
0705cb4
0705cb4
%files -n python3-savitar
0705cb4
%license LICENSE
0705cb4
%doc README.md
0e61bff
%{python3_sitearch}/pySavitar.so
0705cb4
0705cb4
%changelog
40a049c
%autochangelog