From 2bd27ebdb3c63da052cdfaa10012743295e1841e Mon Sep 17 00:00:00 2001 From: LongLi Date: Wed, 27 Nov 2019 18:27:52 +0800 Subject: [PATCH] CentOS 8: Fix resource-agents-4.1.1-12.el7_6.7.src.rpm build error fix build resource-agents.el7.src.rpm to resource-agents.el8.rpm update build require about python to python3 as build container need explicitly python version Story: 2006729 Task: 37665 Depends-On: https://review.opendev.org/#/c/696481/ Depends-On: https://review.opendev.org/#/c/696050/ Signed-off-by: Long Li Change-Id: Ia7c46f3847e87b3d7e562ca0cb511945535f5f7a --- ...te-package-versioning-for-TIS-format.patch | 2 +- .../centos/meta_patches/PATCH_ORDER | 1 + .../spec-avoid-dir-collisions.patch | 2 +- .../spec-include-TiS-patches.patch | 2 +- ...ec-upgrade-buildRequires-python-2to3.patch | 128 ++++++++++++++++++ 5 files changed, 132 insertions(+), 3 deletions(-) create mode 100644 base/cluster-resource-agents/centos/meta_patches/spec-upgrade-buildRequires-python-2to3.patch diff --git a/base/cluster-resource-agents/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/base/cluster-resource-agents/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch index 3672bf4dc..d0e741989 100644 --- a/base/cluster-resource-agents/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch +++ b/base/cluster-resource-agents/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch @@ -1,7 +1,7 @@ From 85cd40238fb1f76483848007bd1e5663bb3f21ff Mon Sep 17 00:00:00 2001 From: Scott Little Date: Mon, 2 Oct 2017 15:11:59 -0400 -Subject: [PATCH] WRS: 0001-Update-package-versioning-for-TIS-format.patch +Subject: [PATCH] 0001-Update-package-versioning-for-TIS-format.patch --- SPECS/resource-agents.spec | 2 +- diff --git a/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER b/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER index 4ee820903..f6e18c9be 100644 --- a/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER +++ b/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER @@ -2,3 +2,4 @@ spec-include-TiS-patches.patch spec-avoid-dir-collisions.patch 0001-Update-package-versioning-for-TIS-format.patch Disable-creation-of-the-debug-package.patch +spec-upgrade-buildRequires-python-2to3.patch diff --git a/base/cluster-resource-agents/centos/meta_patches/spec-avoid-dir-collisions.patch b/base/cluster-resource-agents/centos/meta_patches/spec-avoid-dir-collisions.patch index d9b08171e..6e581c3d7 100644 --- a/base/cluster-resource-agents/centos/meta_patches/spec-avoid-dir-collisions.patch +++ b/base/cluster-resource-agents/centos/meta_patches/spec-avoid-dir-collisions.patch @@ -1,7 +1,7 @@ From 8c725e6e7a4931066488a74227f902269850a263 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Mon, 2 Oct 2017 15:11:58 -0400 -Subject: [PATCH 02/10] WRS: spec-avoid-dir-collisions.patch +Subject: [PATCH 02/10] spec-avoid-dir-collisions.patch Signed-off-by: zhipengl --- diff --git a/base/cluster-resource-agents/centos/meta_patches/spec-include-TiS-patches.patch b/base/cluster-resource-agents/centos/meta_patches/spec-include-TiS-patches.patch index 1bc1ea023..5a1264419 100644 --- a/base/cluster-resource-agents/centos/meta_patches/spec-include-TiS-patches.patch +++ b/base/cluster-resource-agents/centos/meta_patches/spec-include-TiS-patches.patch @@ -1,7 +1,7 @@ From 1f6128eb7bf5287db6def45f278acf771a711a42 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Mon, 2 Oct 2017 15:11:58 -0400 -Subject: [PATCH] WRS: spec-include-TiS-patches.patch +Subject: [PATCH] spec-include-TiS-patches.patch Signed-off-by: zhipengl --- diff --git a/base/cluster-resource-agents/centos/meta_patches/spec-upgrade-buildRequires-python-2to3.patch b/base/cluster-resource-agents/centos/meta_patches/spec-upgrade-buildRequires-python-2to3.patch new file mode 100644 index 000000000..db8a81382 --- /dev/null +++ b/base/cluster-resource-agents/centos/meta_patches/spec-upgrade-buildRequires-python-2to3.patch @@ -0,0 +1,128 @@ +From 96b004fbbc6a4bcdb07ffcfb3d332193c16d4280 Mon Sep 17 00:00:00 2001 +From: Long Li +Date: Tue, 26 Nov 2019 16:44:38 +0800 +Subject: [PATCH] spec-upgrade-buildRequires-python-2to3 + +Signed-off-by: Long Li +--- + SPECS/resource-agents.spec | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec +index 9399f93..b093dfd 100644 +--- a/SPECS/resource-agents.spec ++++ b/SPECS/resource-agents.spec +@@ -177,7 +177,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + + # Build dependencies + BuildRequires: automake autoconf pkgconfig +-BuildRequires: perl python-devel python-setuptools ++BuildRequires: perl python3-devel python3-setuptools + BuildRequires: libxslt glib2-devel + BuildRequires: which + +@@ -600,42 +600,42 @@ make $JFLAGS + # python-pyroute2 bundle + %ifarch x86_64 + pushd %{pyroute2_dir} +-%{__python2} setup.py build ++%{__python3} setup.py build + popd + + # python-colorama bundle + pushd %{colorama_dir} +-%{__python2} setup.py build ++%{__python3} setup.py build + popd + + # python-jmespath bundle + pushd %{jmespath_dir} +-CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} build --executable="%{__python2} -s" ++CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} build --executable="%{__python3} -s" + popd + + # python-pycryptodome bundle + pushd %{pycryptodome_dir} +-%{__python2} setup.py build ++%{__python3} setup.py build + popd + + # python-aliyun-sdk-core bundle + pushd %{aliyunsdkcore_dir} +-%{__python2} setup.py build ++%{__python3} setup.py build + popd + + # python-aliyun-sdk-ecs bundle + pushd %{aliyunsdkecs_dir} +-%{__python2} setup.py build ++%{__python3} setup.py build + popd + + # python-aliyun-sdk-vpc bundle + pushd %{aliyunsdkvpc_dir} +-%{__python2} setup.py build ++%{__python3} setup.py build + popd + + # aliyuncli bundle + pushd %{aliyuncli_dir} +-%{__python2} setup.py build ++%{__python3} setup.py build + popd + %endif + +@@ -657,42 +657,42 @@ popd + + # python-pyroute2 bundle + pushd %{pyroute2_dir} +-%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + popd + # python-colorama bundle + pushd %{colorama_dir} +-%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + popd + + # python-jmespath bundle + pushd %{jmespath_dir} +-CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + popd + rm %{buildroot}/%{_bindir}/jp.py + + # python-pycryptodome bundle + pushd %{pycryptodome_dir} +-%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + popd + + # python-aliyun-sdk-core bundle + pushd %{aliyunsdkcore_dir} +-%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + popd + + # python-aliyun-sdk-ecs bundle + pushd %{aliyunsdkecs_dir} +-%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + popd + + # python-aliyun-sdk-vpc bundle + pushd %{aliyunsdkvpc_dir} +-%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + popd + + # aliyuncli bundle + pushd %{aliyuncli_dir} +-%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} ++%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib /usr/lib/%{name}/%{bundled_lib_dir} + sed -i -e "/^import sys/asys.path.insert(0, '/usr/lib/%{name}/%{bundled_lib_dir}')" %{buildroot}/%{_bindir}/aliyuncli + mv %{buildroot}/%{_bindir}/aliyuncli %{buildroot}/%{_bindir}/aliyuncli-ra + # aliyun_completer / aliyun_zsh_complete.sh +-- +2.7.4 +