[packages/cura] cleanups

glen glen at pld-linux.org
Fri May 15 10:21:49 CEST 2015


commit 81663a1b3adc296c575b26be18b79ec4819672a5
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri May 15 11:21:40 2015 +0300

    cleanups

 cura-dont-show-nc-stls.patch |  1 +
 cura-system-paths.patch      |  1 +
 cura-version.patch           |  1 +
 cura.spec                    | 43 ++++++++++++++++++-------------------------
 4 files changed, 21 insertions(+), 25 deletions(-)
---
diff --git a/cura.spec b/cura.spec
index 1de110d..cf55600 100644
--- a/cura.spec
+++ b/cura.spec
@@ -8,32 +8,29 @@ Group:		Applications/Engineering
 # Example models are CC-BY-SA
 # TweakAtZ.py is CC-BY-SA
 License:	AGPLv3 and CC-BY-SA
-URL:		http://daid.github.com/Cura/
 Source0:	https://github.com/daid/Cura/archive/%{version}.tar.gz
 # Source0-md5:	f41ba365e5b98907cf55fc70e056c2e8
 Source1:	%{name}
 Source2:	%{name}.desktop
-# UltimakerPlatforms STLs were stripped from the tarball, don't crash because of that
 Patch0:		%{name}-dont-show-nc-stls.patch
-# Use system paths
 Patch1:		%{name}-system-paths.patch
-# Rework the logic of determining the version (didn't work)
 Patch2:		%{name}-version.patch
 Patch3:		%{name}-no-firmware.patch
 Patch4:		%{name}-newlines.patch
+URL:		http://daid.github.com/Cura/
 BuildRequires:	desktop-file-utils
 BuildRequires:	dos2unix
 BuildRequires:	gettext
-BuildRequires:	python-devel
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.219
 Requires:	CuraEngine >= 14.12.1
-#?
-#Requires:	pypy
 Requires:	python-PyOpenGL
 Requires:	python-numpy
 Requires:	python-power
 Requires:	python-serial
 Requires:	python-wxPython
 BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
 Cura is a project which aims to be an single software solution for 3D
@@ -68,36 +65,32 @@ rm -rf resources/locale/po
 # rebuild locales
 cd resources/locale
 rm *.in *.pot
-for FILE in *
-  do msgfmt $FILE/LC_MESSAGES/Cura.po -o $FILE/LC_MESSAGES/Cura.mo
-  rm $FILE/LC_MESSAGES/Cura.po
+for FILE in *; do
+	msgfmt $FILE/LC_MESSAGES/Cura.po -o $FILE/LC_MESSAGES/Cura.mo
+	rm $FILE/LC_MESSAGES/Cura.po
 done
-cd -
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura
-install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/firmware
-install -d $RPM_BUILD_ROOT%{_pixmapsdir}
-install -d $RPM_BUILD_ROOT%{_localedir}
-install -d $RPM_BUILD_ROOT%{_bindir}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{py_sitescriptdir}/Cura,%{_datadir}/%{name}/firmware,%{_pixmapsdir},%{_localedir}}
 
-cp -apr Cura/* $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura
-rm -rf $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura/LICENSE
-cp -apr resources/* $RPM_BUILD_ROOT%{_datadir}/%{name}
-cp -apr plugins $RPM_BUILD_ROOT%{_datadir}/%{name}
-cp -ap %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
+cp -a Cura/* $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura
+rm $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura/LICENSE
+cp -a resources/* $RPM_BUILD_ROOT%{_datadir}/%{name}
+cp -a plugins $RPM_BUILD_ROOT%{_datadir}/%{name}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
 ln -s %{_datadir}/%{name} $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura/resources
 ln -s %{_datadir}/%{name}/%{name}.ico $RPM_BUILD_ROOT%{_pixmapsdir}
 
 # locales
 cp -a $RPM_BUILD_ROOT%{_datadir}/%{name}/locale/* $RPM_BUILD_ROOT%{_localedir}
 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/locale
-ln -s -f %{_localedir}/ $RPM_BUILD_ROOT%{_datadir}/%{name}/ # the app expects the locale folder in here
+ln -sf %{_localedir}/ $RPM_BUILD_ROOT%{_datadir}/%{name}/ # the app expects the locale folder in here
 
 desktop-file-install --dir=$RPM_BUILD_ROOT%{_desktopdir} %{SOURCE2}
 
-%{find_lang} Cura
+%find_lang Cura
+%py_postclean
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -105,8 +98,8 @@ rm -rf $RPM_BUILD_ROOT
 %files -f Cura.lang
 %defattr(644,root,root,755)
 %doc Cura/LICENSE resources/example/Attribution.txt
+%attr(755,root,root) %{_bindir}/%{name}
 %{py_sitescriptdir}/Cura
-%{_datadir}/%{name}
 %{_pixmapsdir}/%{name}.ico
 %{_desktopdir}/%{name}.desktop
-%attr(755,root,root) %{_bindir}/%{name}
+%{_datadir}/%{name}
diff --git a/cura-dont-show-nc-stls.patch b/cura-dont-show-nc-stls.patch
index d814f1d..2bcc0f1 100644
--- a/cura-dont-show-nc-stls.patch
+++ b/cura-dont-show-nc-stls.patch
@@ -1,3 +1,4 @@
+# UltimakerPlatforms STLs were stripped from the tarball, don't crash because of that
 diff -urN Cura-15.02.1.org/Cura/gui/sceneView.py Cura-15.02.1/Cura/gui/sceneView.py
 --- Cura-15.02.1.org/Cura/gui/sceneView.py	2015-02-18 21:22:48.000000000 +0100
 +++ Cura-15.02.1/Cura/gui/sceneView.py	2015-05-14 22:34:56.020409418 +0200
diff --git a/cura-system-paths.patch b/cura-system-paths.patch
index d90f40b..8e345ec 100644
--- a/cura-system-paths.patch
+++ b/cura-system-paths.patch
@@ -1,3 +1,4 @@
+# Use system paths
 diff --git a/Cura/util/pluginInfo.py b/Cura/util/pluginInfo.py
 index 7290c8b..52fa14b 100644
 --- a/Cura/util/pluginInfo.py
diff --git a/cura-version.patch b/cura-version.patch
index 8749999..8bef0e2 100644
--- a/cura-version.patch
+++ b/cura-version.patch
@@ -1,3 +1,4 @@
+# Rework the logic of determining the version (didn't work)
 diff --git a/Cura/util/version.py b/Cura/util/version.py
 index 56faeee..add5eb0 100644
 --- a/Cura/util/version.py
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cura.git/commitdiff/81663a1b3adc296c575b26be18b79ec4819672a5



More information about the pld-cvs-commit mailing list