]>
Commit | Line | Data |
---|---|---|
898d83fe JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do not perform "make test" | |
4 | ||
44f39427 JR |
5 | %define module Uranium |
6 | Summary: A Python framework for building desktop applications | |
7 | Name: python3-%{module} | |
59395f77 JR |
8 | Version: 4.5.0 |
9 | Release: 1 | |
44f39427 JR |
10 | License: AGPLv3+ |
11 | Group: Libraries/Python | |
12 | URL: https://github.com/Ultimaker/Uranium | |
13 | Source0: https://github.com/Ultimaker/Uranium/archive/%{version}/%{module}-%{version}.tar.gz | |
59395f77 | 14 | # Source0-md5: ebfbcb5d98fbf4056aa00a72051499c6 |
0166922d | 15 | Patch0: remove-mypy-test.patch |
ecb05b88 | 16 | Patch1: plugins-path.patch |
44f39427 JR |
17 | BuildRequires: cmake |
18 | BuildRequires: doxygen | |
19 | BuildRequires: gettext-tools | |
20 | BuildRequires: python3-Arcus = %{version} | |
21 | BuildRequires: python3-devel | |
22 | BuildRequires: python3-numpy | |
23 | BuildRequires: python3-pytest | |
24 | BuildRequires: python3-scipy | |
0166922d | 25 | BuildRequires: python3-shapely |
44f39427 JR |
26 | BuildRequires: sip-PyQt5 |
27 | Requires: python3-Arcus = %{version} | |
28 | Requires: python3-PyQt5 | |
29 | Requires: python3-numpy | |
30 | Requires: python3-scipy | |
0166922d | 31 | Requires: python3-shapely |
3427ea0f | 32 | Obsoletes: python3-UM |
44f39427 JR |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | Uranium is a Python framework for building 3D printing related | |
38 | applications. | |
39 | ||
40 | %package doc | |
41 | Summary: Documentation for %{name} package | |
42 | Group: Documentation | |
43 | ||
44 | %description doc | |
45 | Documentation for Uranium, a Python framework for building 3D printing | |
46 | related applications. | |
47 | ||
48 | %prep | |
49 | %setup -q -n %{module}-%{version} | |
50 | %patch0 -p1 | |
ecb05b88 | 51 | %patch1 -p1 |
44f39427 | 52 | |
0166922d JR |
53 | for bad_lang in de_DE es_ES fi_FI fr_FR hu_HU it_IT ja_JP ko_KR nl_NL pl_PL pt_PT ru_RU tr_TR ; do |
54 | lang="$(echo $bad_lang | sed 's/_.*//')" | |
55 | %{__mv} "resources/i18n/$bad_lang" "resources/i18n/$lang" | |
56 | done | |
57 | ||
44f39427 JR |
58 | # Upstream installs to lib/python3/dist-packages |
59 | # We want to install to %%{py3_sitescriptdir} | |
0166922d | 60 | sed -i 's|lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.*/.*-packages|%(echo %{py3_sitescriptdir} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt |
44f39427 JR |
61 | |
62 | # empty file. appending to the end to make sure we are not overriding | |
63 | # a non empty file in the future | |
64 | echo '# empty' >> UM/Settings/ContainerRegistryInterface.py | |
65 | ||
66 | # The failing test is reported at https://github.com/Ultimaker/Uranium/issues/225 | |
67 | %{__rm} -r tests/MimeTypes | |
68 | ||
69 | %build | |
70 | mkdir build | |
71 | cd build | |
72 | %{cmake} .. | |
73 | %{__make} | |
74 | %{__make} doc | |
75 | ||
898d83fe | 76 | %{?with_tests:%{__make} test} |
44f39427 JR |
77 | |
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %{__make} -C build install \ | |
82 | DESTDIR=$RPM_BUILD_ROOT | |
83 | ||
84 | # Move the cmake files | |
85 | mv $RPM_BUILD_ROOT%{_datadir}/cmake* $RPM_BUILD_ROOT%{_datadir}/cmake | |
86 | ||
87 | # Sanitize the location of locale files | |
88 | mv $RPM_BUILD_ROOT%{_datadir}/{uranium/resources/i18n,locale} | |
89 | ln -s ../../locale $RPM_BUILD_ROOT%{_datadir}/uranium/resources/i18n | |
90 | rm $RPM_BUILD_ROOT%{_localedir}/uranium.pot | |
91 | rm $RPM_BUILD_ROOT%{_localedir}/*/uranium.po | |
92 | ||
93 | %find_lang uranium | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %files -f uranium.lang | |
99 | %defattr(644,root,root,755) | |
100 | %doc README.md | |
101 | %{py3_sitescriptdir}/UM | |
102 | %{_datadir}/uranium | |
103 | %{_datadir}/cmake | |
104 | ||
105 | %files doc | |
106 | %defattr(644,root,root,755) | |
107 | %doc html |