| |
@@ -30,12 +30,21 @@
|
| |
|
| |
|
| |
# Flat package, i.e. python36, python37, python38 for tox etc.
|
| |
- # warning: changes some other defaults
|
| |
+ # WARNING: This also influences the main_python bcond below.
|
| |
# in Fedora, never turn this on for the python3 package
|
| |
# and always keep it on for python37 etc.
|
| |
- # WARNING: This does not change the package name and summary above
|
| |
+ # WARNING: This does not change the package name and summary above.
|
| |
%bcond_without flatpackage
|
| |
|
| |
+ # Main Python, i.e. whether this is the main Python version in the distribution
|
| |
+ # that owns /usr/bin/python3 and other unique paths
|
| |
+ # Default: if this is a flatpackage -> it is not the main Python
|
| |
+ %if %{with flatpackage}
|
| |
+ %bcond_with main_python
|
| |
+ %else
|
| |
+ %bcond_without main_python
|
| |
+ %endif
|
| |
+
|
| |
# When bootstrapping python3, we need to build setuptools.
|
| |
# but setuptools BR python3-devel and that brings in python3-rpm-generators;
|
| |
# python3-rpm-generators needs python3-setuptools, so we cannot have it yet.
|
| |
@@ -45,7 +54,7 @@
|
| |
# IMPORTANT: When bootstrapping, it's very likely the wheels for pip and
|
| |
# setuptools are not available. Turn off the rpmwheels bcond until
|
| |
# the two packages are built with wheels to get around the issue.
|
| |
- %bcond_without bootstrap
|
| |
+ %bcond_with bootstrap
|
| |
|
| |
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
|
| |
# Uses upstream bundled prebuilt wheels otherwise
|
| |
@@ -311,12 +320,14 @@
|
| |
# replace python36-3.6.2.
|
| |
Obsoletes: python%{pyshortver}
|
| |
|
| |
+ %if %{with main_python}
|
| |
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
|
| |
# https://fedoraproject.org/wiki/Changes/Python_means_Python3
|
| |
# We recommend /usr/bin/python so users get it by default
|
| |
# Versioned recommends are problematic, and we know that the package requires
|
| |
# python3 back with fixed version, so we just use the path here:
|
| |
Recommends: %{_bindir}/python
|
| |
+ %endif
|
| |
|
| |
# In Fedora 31, /usr/bin/pydoc was moved here from Python 2.
|
| |
# Ideally we'd have an explicit conflict with "/usr/bin/pydoc < 3",
|
| |
@@ -358,6 +369,7 @@
|
| |
the "%{name}-" prefix.
|
| |
|
| |
|
| |
+ %if %{with main_python}
|
| |
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
|
| |
# https://fedoraproject.org/wiki/Changes/Python_means_Python3
|
| |
%package -n python-unversioned-command
|
| |
@@ -373,6 +385,8 @@
|
| |
%description -n python-unversioned-command
|
| |
This package contains /usr/bin/python - the "python" command that runs Python 3.
|
| |
|
| |
+ %endif # with main_python
|
| |
+
|
| |
|
| |
%package libs
|
| |
Summary: Python runtime libraries
|
| |
@@ -393,6 +407,11 @@
|
| |
# See https://bugzilla.redhat.com/show_bug.cgi?id=1547131
|
| |
Recommends: %{name}%{?_isa} = %{version}-%{release}
|
| |
|
| |
+ # tkinter is part of the standard library,
|
| |
+ # but it is torn out to save an unwanted dependency on tk and X11.
|
| |
+ # we recommend it when tk is already installed (for better UX)
|
| |
+ Recommends: (%{name}-tkinter%{?_isa} = %{version}-%{release} if tk%{?_isa})
|
| |
+
|
| |
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
|
| |
# In Fedora 31, several "unversioned" files like /usr/bin/pydoc and all the
|
| |
# "unversioned" provides were moved from python2 to python3.
|
| |
@@ -842,7 +861,7 @@
|
| |
install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__
|
| |
%endif
|
| |
|
| |
- %if %{without flatpackage}
|
| |
+ %if %{with main_python}
|
| |
# add idle3 to menu
|
| |
install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png
|
| |
install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png
|
| |
@@ -921,7 +940,7 @@
|
| |
# Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to
|
| |
# avoid the user having to know the precise version and ABI flags.
|
| |
# See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748
|
| |
- %if %{with debug_build} && %{without flatpackage}
|
| |
+ %if %{with debug_build} && %{with main_python}
|
| |
ln -s \
|
| |
%{_bindir}/python%{LDVERSION_debug} \
|
| |
%{buildroot}%{_bindir}/python3-debug
|
| |
@@ -932,7 +951,7 @@
|
| |
# See https://bugzilla.redhat.com/show_bug.cgi?id=1111275
|
| |
mv %{buildroot}%{_bindir}/2to3-%{pybasever} %{buildroot}%{_bindir}/2to3
|
| |
|
| |
- %if %{with flatpackage}
|
| |
+ %if %{without main_python}
|
| |
# Remove stuff that would conflict with python3 package
|
| |
rm %{buildroot}%{_bindir}/python3
|
| |
rm %{buildroot}%{_bindir}/pydoc3
|
| |
@@ -1008,6 +1027,15 @@
|
| |
ConfName=$1
|
| |
ConfDir=$(pwd)/build/$ConfName
|
| |
|
| |
+ # Fedora sets explicit minimum/maximum TLS versions.
|
| |
+ # Python's test suite assumes that the minimum/maximum version is set to
|
| |
+ # a magic marker. We workaround the test problem by setting:
|
| |
+ export OPENSSL_CONF=/non-existing-file
|
| |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1618753
|
| |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1778357
|
| |
+ # https://bugs.python.org/issue35045
|
| |
+ # https://bugs.python.org/issue38815
|
| |
+
|
| |
echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
|
| |
|
| |
# Note that we're running the tests using the version of the code in the
|
| |
@@ -1052,7 +1080,7 @@
|
| |
%files
|
| |
%doc README.rst
|
| |
|
| |
- %if %{without flatpackage}
|
| |
+ %if %{with main_python}
|
| |
%{_bindir}/pydoc*
|
| |
%{_bindir}/python3
|
| |
%else
|
| |
@@ -1064,11 +1092,15 @@
|
| |
%{_mandir}/*/*3*
|
| |
|
| |
|
| |
+ %if %{with main_python}
|
| |
%if %{without flatpackage}
|
| |
%files -n python-unversioned-command
|
| |
+ %endif
|
| |
%{_bindir}/python
|
| |
%{_mandir}/*/python.1*
|
| |
+ %endif
|
| |
|
| |
+ %if %{without flatpackage}
|
| |
%files libs
|
| |
%doc README.rst
|
| |
%endif
|
| |
@@ -1282,13 +1314,16 @@
|
| |
%{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
|
| |
|
| |
%{_libdir}/%{py_INSTSONAME_optimized}
|
| |
- %if %{without flatpackage}
|
| |
+ %if %{with main_python}
|
| |
%{_libdir}/libpython3.so
|
| |
%endif
|
| |
|
| |
|
| |
%if %{without flatpackage}
|
| |
%files devel
|
| |
+ %endif
|
| |
+
|
| |
+ %if %{with main_python}
|
| |
%{_bindir}/2to3
|
| |
%endif
|
| |
|
| |
@@ -1302,7 +1337,7 @@
|
| |
%{_includedir}/python%{LDVERSION_optimized}/cpython/
|
| |
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
|
| |
|
| |
- %if %{without flatpackage}
|
| |
+ %if %{with main_python}
|
| |
%{_bindir}/python3-config
|
| |
%{_bindir}/python-config
|
| |
%{_libdir}/pkgconfig/python3.pc
|
| |
@@ -1330,7 +1365,9 @@
|
| |
|
| |
%if %{without flatpackage}
|
| |
%files idle
|
| |
+ %endif
|
| |
|
| |
+ %if %{with main_python}
|
| |
%{_bindir}/idle*
|
| |
%else
|
| |
%{_bindir}/idle%{pybasever}
|
| |
@@ -1338,7 +1375,7 @@
|
| |
|
| |
%{pylibdir}/idlelib
|
| |
|
| |
- %if %{without flatpackage}
|
| |
+ %if %{with main_python}
|
| |
%{_metainfodir}/idle3.appdata.xml
|
| |
%{_datadir}/applications/idle3.desktop
|
| |
%{_datadir}/icons/hicolor/*/apps/idle3.*
|
| |
@@ -1390,6 +1427,9 @@
|
| |
%if %{with debug_build}
|
| |
%if %{without flatpackage}
|
| |
%files debug
|
| |
+ %endif
|
| |
+
|
| |
+ %if %{with main_python}
|
| |
%{_bindir}/python3-debug
|
| |
%{_bindir}/python-debug
|
| |
%endif
|
| |
Several commits