delete python2

This commit is contained in:
s17723959267 2020-10-29 11:32:11 +08:00 committed by 19909236985
parent d6fd5bec00
commit 756762a7c6

View File

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