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 <lilong-neu@neusoft.com>
Change-Id: Ia7c46f3847e87b3d7e562ca0cb511945535f5f7a
This commit is contained in:
LongLi 2019-11-27 18:27:52 +08:00 committed by Long Li
parent 9035cd1be8
commit 2bd27ebdb3
5 changed files with 132 additions and 3 deletions

View File

@ -1,7 +1,7 @@
From 85cd40238fb1f76483848007bd1e5663bb3f21ff Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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 +-

View File

@ -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

View File

@ -1,7 +1,7 @@
From 8c725e6e7a4931066488a74227f902269850a263 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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 <zhipengs.liu@intel.com>
---

View File

@ -1,7 +1,7 @@
From 1f6128eb7bf5287db6def45f278acf771a711a42 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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 <zhipengs.liu@intel.com>
---

View File

@ -0,0 +1,128 @@
From 96b004fbbc6a4bcdb07ffcfb3d332193c16d4280 Mon Sep 17 00:00:00 2001
From: Long Li <lilong-neu@neusoft.com>
Date: Tue, 26 Nov 2019 16:44:38 +0800
Subject: [PATCH] spec-upgrade-buildRequires-python-2to3
Signed-off-by: Long Li <lilong-neu@neusoft.com>
---
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