From a2da7cfa0bc9558dcd57b71f259f04749751d046 Mon Sep 17 00:00:00 2001 From: Liu Zixian Date: Sat, 22 Jan 2022 00:09:40 +0800 Subject: [PATCH] Fix python macros for python 3.10 Signed-off-by: Liu Zixian --- ...thon3_version-macros-for-Python-3.10.patch | 30 +++++++++++++++++++ openEuler-rpm-config.spec | 8 +++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 Fix-python3_version-macros-for-Python-3.10.patch diff --git a/Fix-python3_version-macros-for-Python-3.10.patch b/Fix-python3_version-macros-for-Python-3.10.patch new file mode 100644 index 0000000..fc76959 --- /dev/null +++ b/Fix-python3_version-macros-for-Python-3.10.patch @@ -0,0 +1,30 @@ +From 84ed1ab69d4b1e0aea452350d9f2865e8f7c28e7 Mon Sep 17 00:00:00 2001 +From: Miro HronĨok +Date: Aug 26 2019 13:24:23 +0000 +Subject: Fix %python3_version macros for Python 3.10 + + +No need to bump the release, 3.10 is far from now. + +Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1745601 + +--- + +diff --git a/macros.python b/macros.python +index 1952aed..a170c4b 100644 +--- a/macros.python ++++ b/macros.python +@@ -139,8 +139,8 @@ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $pyth + %__python3 /usr/bin/python3 + %python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())") + %python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") +-%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])") +-%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") ++%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") ++%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") + %python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())") + %py3dir %{_builddir}/python3-%{name}-%{version}-%{release} + +-- +2.27.0 + diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 2086d0d..4632b1f 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 30 -Release: 22 +Release: 23 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/openeuler/openEuler-rpm-config @@ -17,6 +17,7 @@ Patch3: change-the-openEuler-to-generic-for-common-use.patch Patch4: openEuler-remove-fexceptions.patch Patch5: exclude-kernel-source-and-EFI-files-in-digest-list-building.patch Patch6: add-brp-scripts-to-delete-rpath.patch +Patch7: Fix-python3_version-macros-for-Python-3.10.patch Provides: python-rpm-macros = %{?epoch:%{epoch}:}%{version}-%{release} Provides: python2-rpm-macros = %{?epoch:%{epoch}:}%{version}-%{release} @@ -47,7 +48,7 @@ Obsoletes: perl-srpm-macros <= 1-28 Obsoletes: rust-srpm-macros <= 10-1 Obsoletes: go-srpm-macros <= 2-18 -%if %{vendor} != openEuler +%if "%{vendor}" != "openEuler" Provides: openEuler-rpm-config = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: openEuler-rpm-config <= %{?epoch:%{epoch}:}%{version}-%{release} %endif @@ -113,6 +114,9 @@ mkdir -p %{buildroot}%{_fileattrsdir} %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Fri Jan 21 2022 Liu Zixian - 30-23 +- fix python macros + * Sat Sep 4 2021 yangmingtai - 30-22 - add brp scripts to delete rpath -- Gitee