!21 add bootstrap for rebuild python3-3.9.9

Merge pull request !21 from 桐小哥/openEuler-22.03-LTS-Next
This commit is contained in:
openeuler-ci-bot 2021-12-29 13:53:02 +00:00 committed by Gitee
commit 07eb7fa60d

View File

@ -1,3 +1,6 @@
%global _with_bootstrap 1
%bcond_with bootstrap
%bcond_with tests
%global python3_record %{python3_sitelib}/setuptools-%{version}.dist-info/RECORD
@ -7,7 +10,7 @@
Name: python-setuptools
Version: 59.4.0
Release: 1
Release: 2
Summary: Easily build and distribute Python packages
License: MIT and (BSD or ASL 2.0)
@ -23,7 +26,9 @@ BuildRequires: python3-pip, python3-mock
BuildRequires: python3-pytest, python3-pytest-fixture-config
BuildRequires: python3-pytest-virtualenv
%endif
%if %{without bootstrap}
BuildRequires: python3-pip, python3-wheel
%endif
Provides: python-distribute = %{version}-%{release}, %{name}-wheel
Obsoletes: python-distribute < 0.6.36-2, %{name}-wheel
@ -37,6 +42,8 @@ This package contains a python wheel of setuptools to use with venv.
%package -n python3-setuptools
Summary: Easily build and distribute Python 3 packages
Provides: python%{python3_pkgversion}dist(setuptools) = %{version}
Provides: python%{python3_version}dist(setuptools) = %{version}
Conflicts: python-setuptools < %{version}-%{release}
%description -n python3-setuptools
@ -58,9 +65,14 @@ rm setuptools/tests/test_integration.py
chmod -x README.rst
%build
%if %{without bootstrap}
%py3_build_wheel
%else
%py3_build
%endif
%install
%if %{without bootstrap}
%py3_install_wheel %{python_whlname}
sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
rm -rf %{buildroot}%{python3_sitelib}/{setuptools, pkg_resources}/tests
@ -70,6 +82,9 @@ find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
rm -r docs/{conf.py,_*}
mkdir -p %{buildroot}%{python_whldir}
install -p dist/%{python_whlname} -t %{buildroot}%{python_whldir}
%else
%py3_install
%endif
%if %{with tests}
%check
@ -79,8 +94,10 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=
%files
%defattr(-,root,root)
%license LICENSE
%if %{without bootstrap}
%dir %{python_whldir}/
%{python_whldir}/%{python_whlname}
%endif
%files -n python3-setuptools
%defattr(-,root,root)
@ -95,6 +112,9 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=
%changelog
* Wed Dec 29 2021 shixuantong <shixuantong@huawei.com> - 59.4.0-2
- add bootstrap for rebuild python3-3.9.9
* Wed Dec 22 2021 renhongxun<renhongxun@huawei.com> - 59.4.0-1
- upgrade version to 59.4.0