!5 remove python2

From: @wcc_140409
Reviewed-by: @overweight
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2020-10-30 17:51:47 +08:00 committed by Gitee
commit a4b429a977

View File

@ -17,7 +17,7 @@ Here is a list of its essential features:\
Name: python-%{modname} Name: python-%{modname}
Summary: Python Lex-Yacc Summary: Python Lex-Yacc
Version: 3.11 Version: 3.11
Release: 1 Release: 2
License: BSD License: BSD
URL: http://www.dabeaz.com/ply/ URL: http://www.dabeaz.com/ply/
Source0: http://www.dabeaz.com/ply/%{modname}-%{version}.tar.gz Source0: http://www.dabeaz.com/ply/%{modname}-%{version}.tar.gz
@ -25,89 +25,50 @@ BuildArch: noarch
%description %{_description} %description %{_description}
%package -n python2-%{modname}
Summary: Python Lex-Yacc
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires: python2-devel python2-setuptools
%description -n python2-%{modname} %{_description}
%if %{with python3}
%package -n python3-%{modname} %package -n python3-%{modname}
Summary: Python Lex-Yacc Summary: Python Lex-Yacc
%{?python_provide:%python_provide python3-%{modname}} %{?python_provide:%python_provide python3-%{modname}}
BuildRequires: python3-devel python3-setuptools BuildRequires: python3-devel python3-setuptools
%description -n python3-%{modname} %{_description} %description -n python3-%{modname} %{_description}
%endif
%package_help %package_help
%prep %prep
%autosetup -c %autosetup -n %{modname}-%{version}
mv %{modname}-%{version} python2 find example/ -type f -exec chmod -x {} ';'
find python2/example/ -type f -exec chmod -x {} ';' find example/ -type f -name '*.py' -exec sed -i \
find python2/example/ -type f -name '*.py' -exec sed -i \
-e '1{\@^#!/usr/bin/env python@d}' -e '1{\@^#!/usr/local/bin/python@d}' \ -e '1{\@^#!/usr/bin/env python@d}' -e '1{\@^#!/usr/local/bin/python@d}' \
{} ';' {} ';'
rm -rf python2/*.egg-info rm -rf *.egg-info
%if %{with python3}
cp -ai python2 python3
%endif
%build %build
pushd python2 %py3_build
%py2_build
popd
%if 0%{?with_python3}
pushd python3
%py3_build
popd
%endif
%install %install
pushd python2 %py3_install
%py2_install
popd
%if %{with python3}
pushd python3
%py3_install
popd
%endif
%check %check
pushd python2/test pushd test
./cleanup.sh
%{__python2} testlex.py
%{__python2} testyacc.py
popd
%if %{with python3}
pushd python3/test
./cleanup.sh ./cleanup.sh
%{__python3} testlex.py %{__python3} testlex.py
%{__python3} testyacc.py %{__python3} testyacc.py
popd popd
%endif
%files -n python2-%{modname}
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}-*.egg-info/
%if %{with python3}
%files -n python3-%{modname} %files -n python3-%{modname}
%{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}-*.egg-info/ %{python3_sitelib}/%{modname}-%{version}-*.egg-info/
%endif
%files help %files help
%doc python2/CHANGES %doc CHANGES
%doc python3/CHANGES
%changelog %changelog
* Fri Oct 30 2020 wuchaochao <wuchaochao4@huawei.com> - 3.11-2
- Type:bufix
- CVE:NA
- SUG:NA
- DESC:remove python2
* Fri Jul 24 tianwei <tianwei12@huawei.com> - 3.11-1 * Fri Jul 24 tianwei <tianwei12@huawei.com> - 3.11-1
- update 3.11 - update 3.11