!4 delete python2.

From: @weiwei_150212
Reviewed-by: @hanxinke
Signed-off-by: @hanxinke
This commit is contained in:
openeuler-ci-bot 2020-11-05 10:46:26 +08:00 committed by Gitee
commit 17f385945d

View File

@ -1,10 +1,8 @@
%global pypi_name jsonpatch
%bcond_without python3
%bcond_without python2
Name: python-%{pypi_name}
Version: 1.26
Release: 1
Release: 2
Summary: Applying JSON Patches in Python
License: BSD
URL: https://github.com/stefankoegl/python-json-patch
@ -15,16 +13,6 @@ BuildArch: noarch
%description
Library to apply JSON Patches according to RFC 6902 - Python 2 build.
%if %{with python2}
%package -n python2-jsonpatch
Summary: Applying JSON Patches in Python 2
BuildRequires: python2-devel python2-setuptools python2-jsonpointer
Requires: python2-jsonpointer
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
Library to apply JSON Patches according to RFC 6902 - Python 2 build.
%endif
%package -n python3-jsonpatch
Summary: Applying JSON Patches in Python 3
@ -41,21 +29,10 @@ Library to apply JSON Patches according to RFC 6902 - Python 3 build.
%autosetup -n %{pypi_name}-%{version} -p1
%build
%if %{with python2}
%py2_build
%endif
LANG=en_US.utf8
%py3_build
%install
%if %{with python2}
%py2_install
for bin in jsondiff jsonpatch; do
mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python2_version}
ln -s ./$bin-%{python2_version} %{buildroot}%{_bindir}/$bin-2
done;
%endif
LANG=en_US.utf8 %py3_install
for bin in jsondiff jsonpatch; do
mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python3_version}
@ -64,19 +41,8 @@ ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin
done;
%check
%if %{with python2}
%{__python2} tests.py
%endif
%{__python3} tests.py
%if %{with python2}
%files -n python2-%{pypi_name}
%license COPYING
%{_bindir}/jsondiff-2*
%{_bindir}/jsonpatch-2*
%{python2_sitelib}/%{pypi_name}.py*
%{python2_sitelib}/*.egg-info
%endif
%files -n python3-%{pypi_name}
%license COPYING
@ -93,6 +59,9 @@ done;
%doc README.md
%changelog
* Thu Oct 29 2020 tinawei <tianwei12@huawei.com> - 1.26-2
- delete python2
* Thu Jul 23 2020 dingyue <dingyue5@huawei.com> - 1.26-1
- Package update to 1.26