]>
Commit | Line | Data |
---|---|---|
c177b629 JR |
1 | # |
2 | # TODO: find out why all Ultimaker printers later than 2 cannot be added | |
3 | # | |
30bab2a9 AM |
4 | Summary: 3D printer control software |
5 | Name: cura | |
bb32f111 | 6 | Version: 2.5.0 |
e6494e81 | 7 | Release: 3 |
bb32f111 | 8 | Epoch: 1 |
30bab2a9 AM |
9 | Group: Applications/Engineering |
10 | # Code is AGPLv3 | |
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 | |
bb32f111 JR |
15 | Source0: https://github.com/Ultimaker/Cura/archive/%{version}/%{name}-%{version}.tar.gz |
16 | # Source0-md5: ebe1b78c8b9ce77c289a266c9e732dc8 | |
e6494e81 JR |
17 | Source1: https://github.com/Ultimaker/fdm_materials/archive/%{version}/fdm_materials-%{version}.tar.gz |
18 | # Source1-md5: bf8f25394273d7b6333a856b6a1c94ce | |
bb32f111 JR |
19 | Patch0: plugins-path.patch |
20 | URL: https://ultimaker.com/en/products/cura-software | |
21 | BuildRequires: cmake | |
30bab2a9 AM |
22 | BuildRequires: desktop-file-utils |
23 | BuildRequires: dos2unix | |
bb32f111 | 24 | BuildRequires: gettext |
2c51c5a7 | 25 | BuildRequires: gettext-tools |
bb32f111 JR |
26 | BuildRequires: python3-Uranium = %{version} |
27 | BuildRequires: python3-devel | |
28 | BuildRequires: python3-pytest | |
81663a1b ER |
29 | BuildRequires: rpm-pythonprov |
30 | BuildRequires: rpmbuild(macros) >= 1.219 | |
bb32f111 JR |
31 | Requires: CuraEngine = %{epoch}:%{version} |
32 | Requires: Qt5Quick-controls | |
33 | Requires: fonts-TTF-OpenSans | |
34 | Requires: python3-PyOpenGL | |
35 | Requires: python3-PyQt5 | |
36 | Requires: python3-numpy | |
37 | Requires: python3-power | |
38 | Requires: python3-savitar | |
39 | Requires: python3-serial | |
40 | Requires: python3-Uranium = %{version} | |
41 | Requires: python3-zeroconf | |
30bab2a9 | 42 | BuildArch: noarch |
81663a1b | 43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
30bab2a9 AM |
44 | |
45 | %description | |
46 | Cura is a project which aims to be an single software solution for 3D | |
47 | printing. While it is developed to be used with the Ultimaker 3D | |
48 | printer, it can be used with other RepRap based designs. | |
49 | ||
50 | Cura helps you to setup an Ultimaker, shows your 3D model, allows for | |
51 | scaling / positioning, can slice the model to G-Code, with sane | |
52 | editable configuration settings and send this G-Code to the 3D printer | |
53 | for printing. | |
54 | ||
55 | %prep | |
e6494e81 | 56 | %setup -q -n Cura-%{version} -a1 |
30bab2a9 | 57 | %patch0 -p1 |
30bab2a9 | 58 | |
bb32f111 JR |
59 | # The setup.py is only useful for py2exe, remove it, so noone is tempted to use it |
60 | rm setup.py | |
30bab2a9 | 61 | |
bb32f111 JR |
62 | # https://github.com/Ultimaker/Cura/issues/1784 |
63 | sed -i 's/Version=1/Version=1.1/' cura.desktop.in | |
30bab2a9 | 64 | |
bb32f111 JR |
65 | # Upstream installs to lib/python3/dist-packages |
66 | # We want to install to %%{py3_sitescriptdir} | |
67 | sed -i 's|lib/python${PYTHON_VERSION_MAJOR}/dist-packages|%(echo %{py3_sitescriptdir} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt | |
30bab2a9 | 68 | |
bb32f111 JR |
69 | # Wrong end of line encoding |
70 | dos2unix docs/How_to_use_the_flame_graph_profiler.md | |
71 | ||
72 | # Wrong shebang | |
73 | sed -i '1s=^#!%{_bindir}/\(python\|env python\)3*=#!%{__python3}=' cura_app.py | |
74 | ||
75 | # Invalid locale name ptbr | |
76 | # https://github.com/Ultimaker/Uranium/issues/246 | |
77 | mv resources/i18n/{ptbr,pt_BR} | |
eb2968f2 JR |
78 | sed -i 's/"Language: ptbr\\n"/"Language: pt_BR\\n"/' resources/i18n/pt_BR/*.po |
79 | ||
80 | mv resources/i18n/{jp,ja} | |
81 | sed -i 's/"Language: jp\\n"/"Language: ja\\n"/' resources/i18n/ja/*.po | |
bb32f111 JR |
82 | |
83 | # Failing test, mixes sets and lists :( | |
84 | # Changed in master, not reporting to upstream | |
85 | sed -i -e '0,/set()/{s/set()/[]/}' \ | |
86 | -e 's/{/[/g' \ | |
87 | -e 's/}/]/g' \ | |
88 | tests/TestMachineAction.py | |
30bab2a9 AM |
89 | |
90 | %build | |
bb32f111 JR |
91 | mkdir build |
92 | cd build | |
93 | %{cmake} .. \ | |
94 | -DCURA_VERSION:STRING=%{version} | |
95 | ||
96 | %{__make} | |
30bab2a9 | 97 | |
e6494e81 JR |
98 | cd ../fdm_materials-%{version} |
99 | mkdir build | |
100 | cd build | |
101 | %{cmake} .. | |
102 | ||
103 | %{__make} | |
104 | ||
30bab2a9 AM |
105 | %install |
106 | rm -rf $RPM_BUILD_ROOT | |
e6494e81 | 107 | |
bb32f111 | 108 | %{__make} -C build install DESTDIR=$RPM_BUILD_ROOT |
e6494e81 | 109 | %{__make} -C fdm_materials-%{version}/build install DESTDIR=$RPM_BUILD_ROOT |
30bab2a9 | 110 | |
bb32f111 JR |
111 | # Sanitize the location of locale files |
112 | mv $RPM_BUILD_ROOT%{_datadir}/{cura/resources/i18n,locale} | |
113 | ln -s ../../locale $RPM_BUILD_ROOT%{_datadir}/cura/resources/i18n | |
114 | rm $RPM_BUILD_ROOT%{_localedir}/*/*.po | |
115 | rm $RPM_BUILD_ROOT%{_localedir}/*.pot | |
30bab2a9 | 116 | |
bb32f111 JR |
117 | # Unbundle fonts |
118 | rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts/ | |
119 | ln -s %{_datadir}/fonts/open-sans/ $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts | |
7d3e6bb0 AM |
120 | |
121 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
122 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
81663a1b | 123 | %py_postclean |
30bab2a9 | 124 | |
bb32f111 JR |
125 | %find_lang cura --all-name |
126 | ||
30bab2a9 AM |
127 | %clean |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
bb32f111 | 130 | %files -f cura.lang |
30bab2a9 | 131 | %defattr(644,root,root,755) |
81663a1b | 132 | %attr(755,root,root) %{_bindir}/%{name} |
bb32f111 | 133 | %{py3_sitescriptdir}/cura |
30bab2a9 | 134 | %{_desktopdir}/%{name}.desktop |
81663a1b | 135 | %{_datadir}/%{name} |
bb32f111 JR |
136 | %{_datadir}/appdata/cura.appdata.xml |
137 | %{_datadir}/mime/packages/cura.xml |