delete python2

This commit is contained in:
s17723959267 2020-10-29 11:36:52 +08:00 committed by 19909236985
parent be7a6eaa17
commit 4bce6bff9a

View File

@ -1,10 +1,8 @@
%global pypi_name jsonpointer %global pypi_name jsonpointer
%bcond_without python3
%bcond_without python2
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 2.0 Version: 2.0
Release: 1 Release: 2
Summary: Resolve JSON Pointers in Python Summary: Resolve JSON Pointers in Python
License: BSD License: BSD
URL: https://github.com/stefankoegl/python-json-pointer URL: https://github.com/stefankoegl/python-json-pointer
@ -14,18 +12,7 @@ BuildArch: noarch
%description %description
python-json-pointer is a Python library for resolving JSON pointers (RFC 6901). Python 2.7, 3.4+ and PyPy are supported. python-json-pointer is a Python library for resolving JSON pointers (RFC 6901). Python 2.7, 3.4+ and PyPy are supported.
%if %{with python2}
%package -n python2-%{pypi_name}
Summary: Resolve JSON Pointers in Python
BuildRequires: python2-devel python2-setuptools
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
python-json-pointer is a Python library for resolving JSON pointers (RFC 6901).
%endif
%if %{with python3}
%package -n python3-%{pypi_name} %package -n python3-%{pypi_name}
Summary: Resolve JSON Pointers in Python Summary: Resolve JSON Pointers in Python
BuildRequires: python3-devel python3-setuptools BuildRequires: python3-devel python3-setuptools
@ -34,7 +21,6 @@ BuildRequires: python3-devel python3-setuptools
%description -n python3-%{pypi_name} %description -n python3-%{pypi_name}
python-json-pointer is a Python library for resolving JSON pointers (RFC 6901). python-json-pointer is a Python library for resolving JSON pointers (RFC 6901).
%endif
%package_help %package_help
@ -42,62 +28,35 @@ python-json-pointer is a Python library for resolving JSON pointers (RFC 6901).
%autosetup -n %{pypi_name}-%{version} %autosetup -n %{pypi_name}-%{version}
%build %build
%if %{with python2}
%py2_build
%endif
%if %{with python3}
LC_ALL=en_US.UTF-8 %py3_build LC_ALL=en_US.UTF-8 %py3_build
%endif
%install %install
%if %{with python2}
%py2_install
mv %{buildroot}%{_bindir}/jsonpointer %{buildroot}%{_bindir}/jsonpointer-%{python2_version}
ln -s ./jsonpointer-%{python2_version} %{buildroot}%{_bindir}/jsonpointer-2
%if %{without python3}
ln -s ./jsonpointer-%{python2_version} %{buildroot}%{_bindir}/jsonpointer
%endif
%endif
%if %{with python3}
LC_ALL=en_US.UTF-8 %py3_install LC_ALL=en_US.UTF-8 %py3_install
mv %{buildroot}%{_bindir}/jsonpointer %{buildroot}%{_bindir}/jsonpointer-%{python3_version} mv %{buildroot}%{_bindir}/jsonpointer %{buildroot}%{_bindir}/jsonpointer-%{python3_version}
ln -s ./jsonpointer-%{python3_version} %{buildroot}%{_bindir}/jsonpointer-3 ln -s ./jsonpointer-%{python3_version} %{buildroot}%{_bindir}/jsonpointer-3
ln -s ./jsonpointer-%{python3_version} %{buildroot}%{_bindir}/jsonpointer ln -s ./jsonpointer-%{python3_version} %{buildroot}%{_bindir}/jsonpointer
%endif
%check %check
%if %{with python3}
%{__python3} tests.py %{__python3} tests.py
%endif
%if %{with python2}
%{__python2} tests.py
%endif
%if %{with python2}
%files -n python2-%{pypi_name}
%if %{without python3}
%{_bindir}/jsonpointer
%endif
%{_bindir}/jsonpointer-2*
%{python2_sitelib}/%{pypi_name}.py*
%{python2_sitelib}/*.egg-info
%endif
%if %{with python3}
%files -n python3-%{pypi_name} %files -n python3-%{pypi_name}
%{_bindir}/jsonpointer %{_bindir}/jsonpointer
%{_bindir}/jsonpointer-3* %{_bindir}/jsonpointer-3*
%{python3_sitelib}/__pycache__/* %{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{pypi_name}.py* %{python3_sitelib}/%{pypi_name}.py*
%{python3_sitelib}/*.egg-info %{python3_sitelib}/*.egg-info
%endif
%files help %files help
%doc README.md %doc README.md
%changelog %changelog
* Thu Oct 29 tianwei <tianwei12@huawei.com> - 2.0-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:delete python2
* Thu Jul 23 dingyue <dingyue5@huawei.com> - 2.0-1 * Thu Jul 23 dingyue <dingyue5@huawei.com> - 2.0-1
- Type:enhancement - Type:enhancement
- ID:NA - ID:NA