clean up a bit:

- delete not used patches
- delete odd manual file provides (/usr/bin/*) - rpm will generate them
- be sure to not forget to apply a patch by switching to %%autopatch
- delete very old and not needed nowadays Obsoletes and Conflicts
- use %%EVRD for more strict Requires and Provides like most other packages
- delete README.urpmi which is mostly useless now in dnf platforms
  (we decided that most people do not read such messages or may just miss them
   when a lot of packages are being installed)
This commit is contained in:
Mikhail Novosyolov 2020-07-01 13:50:50 +03:00
parent 46c9d2728e
commit e8e05acc52
3 changed files with 24 additions and 131 deletions

View file

@ -1,51 +0,0 @@
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index 4748ba4..fc02255 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -1,16 +1,27 @@
+import distutils.version
+import glob
import os
import os.path
-import pkgutil
import sys
import tempfile
__all__ = ["version", "bootstrap"]
+_WHEEL_DIR = "/usr/share/python-wheels/"
-_SETUPTOOLS_VERSION = "40.6.2"
-_PIP_VERSION = "18.1"
+def _get_most_recent_wheel_version(pkg):
+ prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))
+ suffix = "-py2.py3-none-any.whl"
+ pattern = "{}*{}".format(prefix, suffix)
+ versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern))
+ return str(max(versions, key=distutils.version.LooseVersion))
+
+
+_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")
+
+_PIP_VERSION = _get_most_recent_wheel_version("pip")
_PROJECTS = [
("setuptools", _SETUPTOOLS_VERSION),
@@ -94,12 +105,9 @@ def _bootstrap(*, root=None, upgrade=False, user=False,
additional_paths = []
for project, version in _PROJECTS:
wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)
- whl = pkgutil.get_data(
- "ensurepip",
- "_bundled/{}".format(wheel_name),
- )
- with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
- fp.write(whl)
+ with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp:
+ with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
+ fp.write(sfp.read())
additional_paths.append(os.path.join(tmpdir, wheel_name))

View file

@ -1,21 +0,0 @@
diff -up ./setup.py.orig ./setup.py
--- ./setup.py.orig 2019-01-01 20:17:55.775281126 +0200
+++ ./setup.py 2019-01-01 20:18:41.833486600 +0200
@@ -670,7 +670,7 @@ class PyBuildExt(build_ext):
libraries=['m']) )
# time libraries: librt may be needed for clock_gettime()
- time_libs = []
+ time_libs = ['m']
lib = sysconfig.get_config_var('TIMEMODULE_LIB')
if lib:
time_libs.append(lib)
@@ -1965,7 +1965,7 @@ class PyBuildExt(build_ext):
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
- libraries=[],
+ libraries=['m', 'dl'],
sources=sources,
depends=depends)
# function my_sqrt() needs libm for sqrt()

View file

@ -83,11 +83,6 @@ Patch102: 00102-lib64.patch
# Downstream only: not appropriate for upstream
Patch111: 00111-no-static-lib.patch
# 00189 #
# Instead of bundled wheels, use our RPM packaged wheels from
# /usr/share/python-wheels
Patch189: 00189-use-rpm-wheels.patch
# 00205 #
# LIBPL variable in makefile takes LIBPL from configure.ac
# but the LIBPL variable defined there doesn't respect libdir macro
@ -112,7 +107,6 @@ Patch328: 00328-pyc-timestamp-invalidation-mode.patch
#
# Mageia patches
#
Patch500: python3-3.7.1-module-linkage.patch
Patch501: python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch
Patch502: python3-3.7.1-uid-gid-overflows.patch
Patch503: python3-3.5.2-dont-raise-from-py_compile.patch
@ -120,10 +114,7 @@ Patch506: python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch
Patch507: link-C-modules-with-libpython.patch
URL: http://www.python.org/
#Conflicts: tkinter3 < %{version}
Conflicts: %{lib_name}-devel < 3.4
Conflicts: %{develname} < 3.4
Requires: %{lib_name} = %{version}
Requires: %{lib_name} = %{EVRD}
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: blt
@ -140,9 +131,6 @@ BuildRequires: tk tk-devel
BuildRequires: autoconf
BuildRequires: bzip2-devel
BuildRequires: sqlite3-devel
# uncomment once the emacs part no longer conflict with python 2.X
#BuildRequires: emacs
#BuildRequires: emacs-bin
%if %{with valgrind}
BuildRequires: valgrind-devel
%endif
@ -151,12 +139,8 @@ BuildRequires: python3-setuptools
BuildRequires: python3-pip
%endif
Provides: python(abi) = %{dirver}
Provides: /usr/bin/python%{dirver}m
Provides: /usr/bin/python%{dirver}
%if %{without py38}
Provides: /usr/bin/python
Provides: /usr/bin/python%{familyver}
Provides: python = %{version}-%{release}
Provides: python = %{EVRD}
%endif
%description
@ -176,6 +160,8 @@ Tix widget set for Tk and RPM.
Note that documentation for Python is provided in the python-docs
package.
#------------------------------------------------------------------------------
%package -n %{lib_name}
Summary: Shared libraries for Python %{version}
Group: System/Libraries
@ -185,15 +171,15 @@ This packages contains Python shared object library. Python is an
interpreted, interactive, object-oriented programming language often
compared to Tcl, Perl, Scheme or Java.
#------------------------------------------------------------------------------
%package -n %{develname}
Summary: The libraries and header files needed for Python development
Group: Development/Python
Requires: %{name} = %{version}
Requires: %{lib_name} = %{version}
Provides: %{name}-devel = %{version}-%{release}
Provides: %{lib_name_orig}-devel = %{version}-%{release}
Obsoletes: %{_lib}python3.1-devel < %{version}
Obsoletes: %{_lib}python3.2-devel < %{version}-%{release}
Requires: %{name} = %{EVRD}
Requires: %{lib_name} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
Provides: %{lib_name_orig}-devel = %{EVRD}
%description -n %{develname}
The Python programming language's interpreter can be extended with
@ -206,9 +192,11 @@ python package will also need to be installed. You'll probably also
want to install the python-docs package, which contains Python
documentation.
#------------------------------------------------------------------------------
%package docs
Summary: Documentation for the Python programming language
Requires: %{name} = %{version}
Requires: %{name} = %{EVRD}
Requires: xdg-utils
Group: Development/Python
BuildArch: noarch
@ -221,11 +209,14 @@ in ASCII text files and in LaTeX source files.
Install the python-docs package if you'd like to use the documentation
for the Python language.
#------------------------------------------------------------------------------
%package -n tkinter%{sub_ver}
Summary: A graphical user interface for the Python scripting language
Group: Development/Python
Requires: %{name} = %{version}
Requires: tcl tk
Requires: %{name} = %{EVRD}
Requires: tcl
Requires: tk
Provides: python%{sub_ver}-tkinter
%description -n tkinter%{sub_ver}
@ -235,6 +226,8 @@ the Python scripting language.
You should install the tkinter package if you'd like to use a graphical
user interface for Python programming.
#------------------------------------------------------------------------------
%package -n tkinter%{sub_ver}-apps
Summary: Various applications written using tkinter
Group: Development/Python
@ -243,33 +236,15 @@ Requires: tkinter%{sub_ver}
%description -n tkinter%{sub_ver}-apps
Various applications written using tkinter
#------------------------------------------------------------------------------
%prep
%setup -qn Python-%{version}
%patch1 -p1
%autopatch -p1
%if "%{_lib}" == "lib64"
%patch102 -p1
%if "%{_lib}" != "lib64"
%patch102 -p1 -R
%endif
%patch111 -p1
%if %{with rpmwheels}
%patch189 -p1
rm Lib/ensurepip/_bundled/*.whl
%endif
%patch205 -p1
%patch251 -p1
%patch274 -p1
%patch328 -p1
# Mageia patches
#%patch500 -p1
%patch501 -p1
%patch502 -p1
%patch503 -p1
%patch506 -p1
%patch507 -p1
# drop Autoconf version requirement
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
@ -283,15 +258,6 @@ tar xf %{SOURCE1} -C html
find . -type f -print0 | xargs -0 perl -p -i -e 's@/usr/local/bin/python@/usr/bin/python3@'
cat > README.urpmi << EOF
Python interpreter support readline completion by default.
This is only used with the interpreter. In order to remove it,
you can :
1) unset PYTHONSTARTUP when you login
2) create a empty file \$HOME/.pythonrc.py
3) change %{_sysconfdir}/pythonrc.py
EOF
%build
rm -f Modules/Setup.local
@ -445,7 +411,6 @@ export TMP="/tmp" TMPDIR="/tmp"
#WITHIN_PYTHON_RPM_BUILD= make test TESTOPTS="-u network -x $EXCLUDE"
%files
%doc README.urpmi
%{_rpmmacrodir}/*python3*
%{_rpmmacrodir}/*py*bytecompile*
%{_includedir}/python*/pyconfig.h