]> git.pld-linux.org Git - packages/cura.git/blob - cura.spec
- rel 2; compile py files (so py_postclean won't delete all our files)
[packages/cura.git] / cura.spec
1 Summary:        3D printer control software
2 Name:           cura
3 Version:        15.02.1
4 Release:        2
5 Group:          Applications/Engineering
6 # Code is AGPLv3
7 # Icons AGPLv3 https://github.com/daid/Cura/issues/231#issuecomment-12209683
8 # Example models are CC-BY-SA
9 # TweakAtZ.py is CC-BY-SA
10 License:        AGPLv3 and CC-BY-SA
11 Source0:        https://github.com/daid/Cura/archive/%{version}.tar.gz
12 # Source0-md5:  f41ba365e5b98907cf55fc70e056c2e8
13 Source1:        %{name}
14 Source2:        %{name}.desktop
15 Patch0:         %{name}-dont-show-nc-stls.patch
16 Patch1:         %{name}-system-paths.patch
17 Patch2:         %{name}-version.patch
18 Patch3:         %{name}-no-firmware.patch
19 Patch4:         %{name}-newlines.patch
20 URL:            http://daid.github.com/Cura/
21 BuildRequires:  desktop-file-utils
22 BuildRequires:  dos2unix
23 BuildRequires:  gettext-tools
24 BuildRequires:  rpm-pythonprov
25 BuildRequires:  rpmbuild(macros) >= 1.219
26 Requires:       CuraEngine >= 14.12.1
27 Requires:       python-PyOpenGL
28 Requires:       python-numpy
29 Requires:       python-power
30 Requires:       python-serial
31 Requires:       python-wxPython
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %description
36 Cura is a project which aims to be an single software solution for 3D
37 printing. While it is developed to be used with the Ultimaker 3D
38 printer, it can be used with other RepRap based designs.
39
40 Cura helps you to setup an Ultimaker, shows your 3D model, allows for
41 scaling / positioning, can slice the model to G-Code, with sane
42 editable configuration settings and send this G-Code to the 3D printer
43 for printing.
44
45 %prep
46 %setup -qn Cura-%{version}
47 %patch0 -p1
48 %patch1 -p1
49 %patch2 -p1
50 %patch3 -p1
51 %patch4 -p1
52
53 # Use free UltimakerHandle.stl instead of UltimakerRobot_support.stl
54 FILES=$(grep -Ir "UltimakerRobot_support.stl" . | cut -f1 -d: | sort | uniq | grep -v Attribution.txt | tr '\n' ' ')
55 sed -i 's/UltimakerRobot_support.stl/UltimakerHandle.stl/g' $FILES
56
57 dos2unix resources/example/Attribution.txt
58
59 sed -i 's/REPLACE_THIS_IN_SPEC/%{version}/' Cura/util/version.py
60
61 mv resources/locale/{zh,zh_CN}
62 rm -rf resources/locale/{en,po}
63
64 %build
65 # rebuild locales
66 cd resources/locale
67 rm *.in *.pot
68 for FILE in *; do
69         msgfmt $FILE/LC_MESSAGES/Cura.po -o $FILE/LC_MESSAGES/Cura.mo
70         rm $FILE/LC_MESSAGES/Cura.po
71 done
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT{%{_bindir},%{py_sitescriptdir}/Cura,%{_datadir}/%{name}/firmware,%{_pixmapsdir},%{_localedir}}
76
77 cp -a Cura/* $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura
78 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura/LICENSE
79 cp -a resources/* $RPM_BUILD_ROOT%{_datadir}/%{name}
80 cp -a plugins $RPM_BUILD_ROOT%{_datadir}/%{name}
81 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
82 ln -s %{_datadir}/%{name} $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura/resources
83 ln -s %{_datadir}/%{name}/%{name}.ico $RPM_BUILD_ROOT%{_pixmapsdir}
84
85 # locales
86 cp -a $RPM_BUILD_ROOT%{_datadir}/%{name}/locale/* $RPM_BUILD_ROOT%{_localedir}
87 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/locale
88 ln -sf %{_localedir}/ $RPM_BUILD_ROOT%{_datadir}/%{name}/ # the app expects the locale folder in here
89
90 desktop-file-install --dir=$RPM_BUILD_ROOT%{_desktopdir} %{SOURCE2}
91
92 %find_lang Cura
93
94 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
95 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
96 %py_postclean
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %files -f Cura.lang
102 %defattr(644,root,root,755)
103 %doc Cura/LICENSE resources/example/Attribution.txt
104 %attr(755,root,root) %{_bindir}/%{name}
105 %{py_sitescriptdir}/Cura
106 %{_pixmapsdir}/%{name}.ico
107 %{_desktopdir}/%{name}.desktop
108 %{_datadir}/%{name}
This page took 0.066431 seconds and 3 git commands to generate.