2 # TODO: find out why all Ultimaker printers later than 2 cannot be added
4 Summary: 3D printer control software
9 Group: Applications/Engineering
11 # Icons AGPLv3 https://github.com/daid/Cura/issues/231#issuecomment-12209683
12 # Example models are CC-BY-SA
13 # TweakAtZ.py is CC-BY-SA
14 License: AGPLv3 and CC-BY-SA
15 Source0: https://github.com/Ultimaker/Cura/archive/%{version}/%{name}-%{version}.tar.gz
16 # Source0-md5: ebe1b78c8b9ce77c289a266c9e732dc8
18 Patch0: plugins-path.patch
19 URL: https://ultimaker.com/en/products/cura-software
21 BuildRequires: desktop-file-utils
22 BuildRequires: dos2unix
23 BuildRequires: gettext
24 BuildRequires: gettext-tools
25 BuildRequires: python3-Uranium = %{version}
26 BuildRequires: python3-devel
27 BuildRequires: python3-pytest
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.219
30 Requires: CuraEngine = %{epoch}:%{version}
31 Requires: Qt5Quick-controls
32 Requires: fonts-TTF-OpenSans
33 Requires: python3-PyOpenGL
34 Requires: python3-PyQt5
35 Requires: python3-numpy
36 Requires: python3-power
37 Requires: python3-savitar
38 Requires: python3-serial
39 Requires: python3-Uranium = %{version}
40 Requires: python3-zeroconf
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 Cura is a project which aims to be an single software solution for 3D
46 printing. While it is developed to be used with the Ultimaker 3D
47 printer, it can be used with other RepRap based designs.
49 Cura helps you to setup an Ultimaker, shows your 3D model, allows for
50 scaling / positioning, can slice the model to G-Code, with sane
51 editable configuration settings and send this G-Code to the 3D printer
55 %setup -q -n Cura-%{version}
58 # The setup.py is only useful for py2exe, remove it, so noone is tempted to use it
61 # https://github.com/Ultimaker/Cura/issues/1784
62 sed -i 's/Version=1/Version=1.1/' cura.desktop.in
64 # Upstream installs to lib/python3/dist-packages
65 # We want to install to %%{py3_sitescriptdir}
66 sed -i 's|lib/python${PYTHON_VERSION_MAJOR}/dist-packages|%(echo %{py3_sitescriptdir} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt
68 # Wrong end of line encoding
69 dos2unix docs/How_to_use_the_flame_graph_profiler.md
72 sed -i '1s=^#!%{_bindir}/\(python\|env python\)3*=#!%{__python3}=' cura_app.py
74 # Invalid locale name ptbr
75 # https://github.com/Ultimaker/Uranium/issues/246
76 mv resources/i18n/{ptbr,pt_BR}
77 sed -i 's/"Language: ptbr\n"/"Language: pt_BR\n"/' resources/i18n/pt_BR/*.po
79 # Failing test, mixes sets and lists :(
80 # Changed in master, not reporting to upstream
81 sed -i -e '0,/set()/{s/set()/[]/}' \
84 tests/TestMachineAction.py
90 -DCURA_VERSION:STRING=%{version}
95 rm -rf $RPM_BUILD_ROOT
96 %{__make} -C build install DESTDIR=$RPM_BUILD_ROOT
98 # Sanitize the location of locale files
99 mv $RPM_BUILD_ROOT%{_datadir}/{cura/resources/i18n,locale}
100 ln -s ../../locale $RPM_BUILD_ROOT%{_datadir}/cura/resources/i18n
101 rm $RPM_BUILD_ROOT%{_localedir}/*/*.po
102 rm $RPM_BUILD_ROOT%{_localedir}/*.pot
105 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts/
106 ln -s %{_datadir}/fonts/open-sans/ $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts
108 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
109 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
112 %find_lang cura --all-name
115 rm -rf $RPM_BUILD_ROOT
118 %defattr(644,root,root,755)
119 %attr(755,root,root) %{_bindir}/%{name}
120 %{py3_sitescriptdir}/cura
121 %{_desktopdir}/%{name}.desktop
123 %{_datadir}/appdata/cura.appdata.xml
124 %{_datadir}/mime/packages/cura.xml