Summary: 3D printer control software
Name: cura
-Version: 2.5.0
-Release: 1
+Version: 4.5.0
+Release: 4
Epoch: 1
Group: Applications/Engineering
# Code is AGPLv3
# TweakAtZ.py is CC-BY-SA
License: AGPLv3 and CC-BY-SA
Source0: https://github.com/Ultimaker/Cura/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: ebe1b78c8b9ce77c289a266c9e732dc8
-Source1: %{name}
+# Source0-md5: b02b95a4669110cff62f96e1bb00b1b5
+Source1: https://github.com/Ultimaker/fdm_materials/archive/%{version}/fdm_materials-%{version}.tar.gz
+# Source1-md5: 449b2301efb4a4616c5c610bae173d0d
Patch0: plugins-path.patch
URL: https://ultimaker.com/en/products/cura-software
BuildRequires: cmake
BuildRequires: desktop-file-utils
-BuildRequires: dos2unix
BuildRequires: gettext
BuildRequires: gettext-tools
BuildRequires: python3-Uranium = %{version}
Requires: fonts-TTF-OpenSans
Requires: python3-PyOpenGL
Requires: python3-PyQt5
+Requires: python3-Uranium = %{version}
Requires: python3-numpy
Requires: python3-power
-Requires: python3-savitar
+Requires: python3-savitar >= 2.7.0
Requires: python3-serial
-Requires: python3-Uranium = %{version}
Requires: python3-zeroconf
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
for printing.
%prep
-%setup -q -n Cura-%{version}
+%setup -q -n Cura-%{version} -a1
%patch0 -p1
-# The setup.py is only useful for py2exe, remove it, so noone is tempted to use it
-rm setup.py
-
-# https://github.com/Ultimaker/Cura/issues/1784
-sed -i 's/Version=1/Version=1.1/' cura.desktop.in
+for bad_lang in de_DE es_ES fi_FI fr_FR it_IT ja_JP ko_KR nl_NL pl_PL pt_PT ru_RU tr_TR ; do
+ lang="$(echo $bad_lang | sed 's/_.*//')"
+ %{__mv} "resources/i18n/$bad_lang" "resources/i18n/$lang"
+done
# Upstream installs to lib/python3/dist-packages
-# We want to install to %%{py3_sitescriptdir}
-sed -i 's|lib/python${PYTHON_VERSION_MAJOR}/dist-packages|%(echo %{py3_sitescriptdir} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt
-
-# Wrong end of line encoding
-dos2unix docs/How_to_use_the_flame_graph_profiler.md
+# We want to install to %{py3_sitescriptdir}
+%{__sed} -i 's|lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.*/.*-packages|%(echo %{py3_sitescriptdir} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt
# Wrong shebang
-sed -i '1s=^#!%{_bindir}/\(python\|env python\)3*=#!%{__python3}=' cura_app.py
-
-# Invalid locale name ptbr
-# https://github.com/Ultimaker/Uranium/issues/246
-mv resources/i18n/{ptbr,pt_BR}
-sed -i 's/"Language: ptbr\n"/"Language: pt_BR\n"/' resources/i18n/pt_BR/*.po
-
-# Failing test, mixes sets and lists :(
-# Changed in master, not reporting to upstream
-sed -i -e '0,/set()/{s/set()/[]/}' \
- -e 's/{/[/g' \
- -e 's/}/]/g' \
- tests/TestMachineAction.py
+%{__sed} -i '1s=^#!%{_bindir}/\(python\|env python\)3*=#!%{__python3}=' cura_app.py
%build
mkdir build
%{__make}
+cd ../fdm_materials-%{version}
+mkdir build
+cd build
+%{cmake} ..
+
+%{__make}
+
%install
rm -rf $RPM_BUILD_ROOT
+
%{__make} -C build install DESTDIR=$RPM_BUILD_ROOT
+%{__make} -C fdm_materials-%{version}/build install DESTDIR=$RPM_BUILD_ROOT
# Sanitize the location of locale files
-mv $RPM_BUILD_ROOT%{_datadir}/{cura/resources/i18n,locale}
+%{__mv} $RPM_BUILD_ROOT%{_datadir}/{cura/resources/i18n,locale}
ln -s ../../locale $RPM_BUILD_ROOT%{_datadir}/cura/resources/i18n
-rm $RPM_BUILD_ROOT%{_localedir}/*/*.po
-rm $RPM_BUILD_ROOT%{_localedir}/*.pot
-
-# Unbundle fonts
-rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts/
-ln -s %{_datadir}/fonts/open-sans/ $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts
+%{__rm} $RPM_BUILD_ROOT%{_localedir}/*/*.po
+%{__rm} $RPM_BUILD_ROOT%{_localedir}/*.pot
%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+%update_icon_cache hicolor
+
+%postun
+%update_icon_cache hicolor
+
%files -f cura.lang
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/%{name}
%{py3_sitescriptdir}/cura
%{_desktopdir}/%{name}.desktop
%{_datadir}/%{name}
-%{_datadir}/appdata/cura.appdata.xml
+%{_datadir}/metainfo/cura.appdata.xml
%{_datadir}/mime/packages/cura.xml
+%{_iconsdir}/hicolor/*x*/apps/cura-icon.png