diff --git a/python3-add-generic-os-support.patch b/python3-add-generic-os-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..c64435a76248b37ef0e99ed9f8623a18fe373682 --- /dev/null +++ b/python3-add-generic-os-support.patch @@ -0,0 +1,24 @@ +diff --git a/Lib/platform.py b/Lib/platform.py +index 6ab06b5..8d41a4b 100755 +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -297,7 +297,7 @@ _release_version = re.compile(r'([^0-9]+)' + # and http://www.die.net/doc/linux/man/man1/lsb_release.1.html + + _supported_dists = ( +- 'SuSE', 'debian', 'fedora', 'redhat', 'centos', ++ 'SuSE', 'debian', 'fedora', 'redhat', 'centos', 'generic_os', + 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', + 'UnitedLinux', 'turbolinux', 'arch', 'mageia') + +@@ -367,6 +367,8 @@ def _linux_distribution(distname, version, id, supported_dists, + return distname, version, id + etc.sort() + for file in etc: ++ if os.path.islink(os.path.join(_UNIXCONFDIR, file)): ++ continue + m = _release_filename.match(file) + if m is not None: + _distname, dummy = m.groups() +-- +2.23.0 diff --git a/python3.spec b/python3.spec index f33eeb3b4b83a333eecbfaa92306a4af9dfefa06..12cb5a36b0c518d6a7b7a1592744ad89e65d8fe4 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ Summary: Interpreter of the Python3 programming language URL: https://www.python.org/ Version: 3.7.4 -Release: 9 +Release: 11 License: Python %global branchversion 3.7 @@ -106,6 +106,8 @@ Patch6001: CVE-2019-16935.patch Patch6002: CVE-2019-17514.patch Patch6003: CVE-2019-9674.patch +Patch9000: python3-add-generic-os-support.patch + Provides: python%{branchversion} = %{version}-%{release} Provides: python(abi) = %{branchversion} @@ -135,6 +137,14 @@ in other languages that need easy-to-use scripting or automation interfaces. This package Provides python version 3. +%package -n python3-unversioned-command +Summary: The "python" command that runs Python 3 +Requires: %{name} = %{version}-%{release} +Provides: python = %{version}-%{release} +Conflicts: python2 +%description -n python3-unversioned-command +This package contains /usr/bin/python - the "python" command that runs Python 3. + %package devel Summary: Libraries and header files needed for Python development Requires: %{name} = %{version}-%{release} @@ -197,6 +207,9 @@ rm Lib/ensurepip/_bundled/*.whl %patch6002 -p1 %patch6003 -p1 +%patch9000 -p1 + +sed -i "s/generic_os/%{_vendor}/g" Lib/platform.py rm configure pyconfig.h.in %build @@ -375,6 +388,8 @@ ln -s \ %{_bindir}/python%{LDVERSION_debug} \ %{buildroot}%{_bindir}/python3-debug +ln -s %{_bindir}/python3 %{buildroot}%{_bindir}/python + mv %{buildroot}%{_bindir}/2to3-%{branchversion} %{buildroot}%{_bindir}/2to3 %check @@ -626,6 +641,8 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP" %{_libdir}/%{py_INSTSONAME_optimized} %{_libdir}/libpython3.so +%files -n python3-unversioned-command +%{_bindir}/python %files devel %{_bindir}/2to3 @@ -796,6 +813,18 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP" %{_mandir}/*/* %changelog +* Tue Jun 2 2020 hanxinke - 3.7.4-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:add python3-unversioned-command package + +* Mon Jun 1 2020 hanxinke - 3.7.4-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:add generic_os support to python3 + * Tue Apr 21 2020 hanxinke - 3.7.4-9 - Type:cves - ID:CVE-2019-9674