File cura-lulzbot.spec of Package cura-lulzbot

#
# spec file for package cura-lulzbot
#
# Copyright (c) 2024 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/
#


# Internal QML import
%global __requires_exclude qmlimport\\(Cura.*

Name:           cura-lulzbot
Version:        4.13.5
Release:        0
Summary:        3D printer control software
License:        AGPL-3.0-only
Group:          Hardware/Printing
URL:            https://gitlab.com/lulzbot3d/cura-le/cura-lulzbot
Source0:        %name-%{version}.tar.xz
Provides:       cura2-lulzbot
Obsoletes:      cura2-lulzbot < 3
Conflicts:      ModemManager
Conflicts:      cura
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  python3-Arcus
BuildRequires:  python3-Savitar
BuildRequires:  python3-keyring >= 21
BuildRequires:  python3-numpy
BuildRequires:  python3-pynest2d
BuildRequires:  python3-pytest
BuildRequires:  python3-qt5
BuildRequires:  python3-requests
BuildRequires:  python3-scipy
BuildRequires:  python3-shapely
BuildRequires:  python3-zeroconf
BuildRequires:  update-desktop-files
BuildRequires:  uranium
# It builds with older Qt, but crashes due to missing qml features
BuildRequires:  pkgconfig(Qt5Core) >= 5.10
Requires:       cura-engine
Requires:       python3-Arcus
Requires:       python3-Savitar
Requires:       python3-keyring >= 21
Requires:       python3-numpy
Requires:       python3-pynest2d
Requires:       python3-pyserial
Requires:       python3-qt5 >= 5.10
Requires:       python3-requests
Requires:       python3-scipy
Requires:       python3-sentry-sdk
Requires:       python3-shapely
Requires:       python3-typing
Requires:       uranium
Recommends:     cura-fdm-materials >= %{version}
Recommends:     python3-trimesh
Recommends:     python3-zeroconf
BuildArch:      noarch
# The CuraEngine is not supported on 32bit Linux anymore
ExcludeArch:    %ix86 %arm s390 ppc

%description
Cura is a software solution for 3D printing.
While it is developed to be used with the Ultimaker 3D printer, it can be used
with other RepRap based designs.

Cura helps in setting up an Ultimaker, shows 3D models, allows for scaling /
positioning, can slice the model to G-Code, has editable configuration
settings, and send this G-Code to the 3D printer for printing.

%prep
%autosetup -n cura-lulzbot-%version -p1
sed -i -e '1 s/env python3/python3/' cura_app.py

%build
export CFLAGS="%{optflags}"
%cmake -DLIB_SUFFIX="" \
       -DCURA_BUILDTYPE=RPM \
       -DCURA_CLOUD_API_ROOT:STRING=https://api.ultimaker.com \
       -DCURA_CLOUD_API_VERSION:STRING=1 \
       -DCURA_CLOUD_ACCOUNT_API_ROOT:STRING=https://account.ultimaker.com \
       -DCURA_VERSION=%version \
       -DCURA_DEBUGMODE=OFF \
       %{nil}
%cmake_build

%install
cd build
%make_install
mv %buildroot%{_bindir}/cura{,-lulzbot}
find %buildroot -name \*.orig | xargs rm
%suse_update_desktop_file cura-lulzbot Graphics 3DGraphics
echo '%defattr(644,root,root,755)' > %{name}.lang
find %{buildroot}%{_datadir} -name *.mo | sed '
  s:'%{buildroot}'::; s:\(.*/i18n/\)\([^/]\+\)\(.*mo\):%lang(\2) \1\2\3:' \
  >> ../%{name}.lang

%fdupes -s %{buildroot}%{_datadir}/%{name}

%files -f %{name}.lang
%license LICENSE
%doc README.md
%_prefix/lib/python3.11/site-packages/cura
%_prefix/lib/cura
%{_datadir}/cura
%{_datadir}/applications/cura-lulzbot.desktop
%{_datadir}/mime/packages/cura.xml
%dir %_datadir/icons/hicolor
%dir %_datadir/icons/hicolor/128x128
%dir %_datadir/icons/hicolor/128x128/apps
%{_datadir}/icons/*/*/*/cura-icon.png
%{_datadir}/metainfo/cura.appdata.xml
%{_bindir}/cura-lulzbot

%changelog
openSUSE Build Service is sponsored by