]> git.pld-linux.org Git - packages/python3-Uranium.git/blob - python3-Uranium.spec
rebuild with python 3.10
[packages/python3-Uranium.git] / python3-Uranium.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # do not perform "make test"
4
5 %define         module          Uranium
6 Summary:        A Python framework for building desktop applications
7 Name:           python3-%{module}
8 Version:        4.5.0
9 Release:        3
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
14 # Source0-md5:  ebfbcb5d98fbf4056aa00a72051499c6
15 Patch0:         remove-mypy-test.patch
16 Patch1:         plugins-path.patch
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
25 BuildRequires:  python3-shapely
26 BuildRequires:  sip-PyQt5
27 Requires:       python3-Arcus = %{version}
28 Requires:       python3-PyQt5
29 Requires:       python3-numpy
30 Requires:       python3-scipy
31 Requires:       python3-shapely
32 Obsoletes:      python3-UM
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
51 %patch1 -p1
52
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
58 # Upstream installs to lib/python3/dist-packages
59 # We want to install to %%{py3_sitescriptdir}
60 sed -i 's|lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.*/.*-packages|%(echo %{py3_sitescriptdir} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt
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
76 %{?with_tests:%{__make} test}
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
This page took 0.067448 seconds and 3 git commands to generate.