|
19 | 19 |
|
20 | 20 | # If they aren't provided by a system installed macro, define them |
21 | 21 | %{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc} |
| 22 | + |
| 23 | +%if 0%{?suse_version} && 0%{?suse_version} < 1600 |
| 24 | +%global __python3 /usr/bin/python3.11 |
| 25 | +%global python3_pkgversion 311 |
| 26 | +%else |
22 | 27 | %{!?__python3: %global __python3 /usr/bin/python3} |
| 28 | +%{!?python3_pkgversion:%global python3_pkgversion 3} |
| 29 | +%endif |
23 | 30 |
|
24 | 31 | %if %{undefined python3_sitelib} |
25 | 32 | %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") |
26 | 33 | %endif |
27 | 34 |
|
28 | | -%if 0%{?el7} |
29 | | -%global python3_pkgversion 36 |
30 | | -%else |
31 | | -%{!?python3_pkgversion:%global python3_pkgversion 3} |
| 35 | +%if %{undefined python3_version} |
| 36 | +%global python3_version %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") |
| 37 | +%endif |
| 38 | + |
| 39 | +%if %{undefined python3_version_nodots} |
| 40 | +%global python3_version_nodots %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") |
32 | 41 | %endif |
33 | 42 |
|
34 | 43 | %if 0%{?debian} || 0%{?ubuntu} |
@@ -85,11 +94,11 @@ image root directory |
85 | 94 |
|
86 | 95 | %build |
87 | 96 | # Build Python 3 version |
88 | | -python3 setup.py build |
| 97 | +%{__python3} setup.py build |
89 | 98 |
|
90 | 99 | %install |
91 | 100 | # Install Python 3 version |
92 | | -python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} |
| 101 | +%{__python3} setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} |
93 | 102 |
|
94 | 103 | # Install man pages and package documentation |
95 | 104 | make buildroot=%{buildroot}/ docdir=%{_defaultdocdir}/ install |
|
0 commit comments