!6 delete about python2 subpackage and use python3 replace python2 for build

From: @yeah_wang
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
This commit is contained in:
openeuler-ci-bot 2020-10-29 19:21:04 +08:00 committed by Gitee
commit 1d61022f7b

View File

@ -1,18 +1,14 @@
Name: python-idna Name: python-idna
Version: 2.10 Version: 2.10
Release: 1 Release: 2
Summary: Internationalized Domain Names in Applications (IDNA) Summary: Internationalized Domain Names in Applications (IDNA)
License: BSD and Python and Unicode License: BSD and Python and Unicode
URL: https://github.com/kjd/idna URL: https://github.com/kjd/idna
Source0: https://files.pythonhosted.org/packages/source/i/idna/idna-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/i/idna/idna-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
%if 0%{?with_python2}
BuildRequires: python2-devel python2-setuptools
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel python3-setuptools BuildRequires: python3-devel python3-setuptools
%endif
%description %description
A library to support the Internationalised Domain Names in A library to support the Internationalised Domain Names in
@ -25,72 +21,35 @@ The library is also intended to act as a suitable drop-in replacement
for the “encodings.idna” module that comes with the Python standard for the “encodings.idna” module that comes with the Python standard
library but currently only supports the older 2003 specification. library but currently only supports the older 2003 specification.
%if 0%{?with_python2}
%package -n python2-idna
Summary: Python2 package for python-idna
Provides: python-idna = %{version}-%{release}
Obsoletes: python-idna < %{version}-%{release}
%description -n python2-idna
Python2 package for python-idna
%endif
%if 0%{?with_python3}
%package -n python3-idna %package -n python3-idna
Summary: Python3 package for python-idna Summary: Python3 package for python-idna
%{?python_provide: %python_provide python3-idna} %{?python_provide: %python_provide python3-idna}
%description -n python3-idna %description -n python3-idna
Python3 package for python-idna Python3 package for python-idna
%endif
%prep %prep
%autosetup -n idna-%{version} -p1 %autosetup -n idna-%{version} -p1
%build %build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build %py3_build
%endif
%install %install
%if 0%{?with_python2}
%py2_install
%endif
%if 0%{?with_python3}
%py3_install %py3_install
%endif
%check %check
%if 0%{?with_python2}
%{__python2} setup.py test
%endif
%if 0%{?with_python3}
%{__python3} setup.py test %{__python3} setup.py test
%endif
%if 0%{?with_python2}
%files -n python2-idna
%defattr(-,root,root)
%doc README.rst HISTORY.rst
%license LICENSE.rst
%{python2_sitelib}/*
%endif
%if 0%{?with_python3}
%files -n python3-idna %files -n python3-idna
%defattr(-,root,root) %defattr(-,root,root)
%doc README.rst HISTORY.rst %doc README.rst HISTORY.rst
%license LICENSE.rst %license LICENSE.rst
%{python3_sitelib}/* %{python3_sitelib}/*
%endif
%changelog %changelog
* Thu Oct 29 2020 wangye <wangye70@huawei.com> - 2.10-2
- remove python2-idna subpackage
* Thu Jul 23 2020 zhouhaibo <zhouhaibo@huawei.com> - 2.10-1 * Thu Jul 23 2020 zhouhaibo <zhouhaibo@huawei.com> - 2.10-1
- Package update - Package update