python-httplib2/python-httplib2.spec
fandehui 756583ed57 Use mock from the standard library
Since Python 3.3, mock is part of unittest in the standard library.

Provide compatibility for older versions, since httplib2 seems to still
support Python2.

Signed-off-by: fandehui <fandehui@xfusion.com>
(cherry picked from commit 151380e3dd1e3e7e6553a4d739df66d02f6b0fbc)
2023-12-28 15:19:13 +08:00

102 lines
2.5 KiB
RPMSpec

Name: python-httplib2
Version: 0.19.0
Release: 3
Summary: Small, fast HTTP client library for Python.
License: MIT
URL: https://github.com/httplib2/httplib2
Source0: https://files.pythonhosted.org/packages/ed/ef/f0e05d5886a9c25dea4b18be06cd7bcaddbae0168cc576f3568f9bd6a35a/httplib2-0.19.0.tar.gz
Patch0: Use-mock-from-the-standard-library.patch
BuildRequires: python2-setuptools python2-devel
%if 0%{?with_python3}
BuildRequires: python3-setuptools python3-devel
%endif
BuildArch: noarch
%description
httplib2 is a comprehensive HTTP client library, httplib2.py supports many
features left out of other HTTP libraries.
%package -n python2-httplib2
Summary: Small, fast HTTP client library for Python.
%{?python_provide:%python_provide python2-httplib2}
%description -n python2-httplib2
Small, fast HTTP client library for Python.
%if 0%{?with_python3}
%package -n python3-httplib2
Summary: Small, fast HTTP client library for Python.
%{?python_provide:%python_provide python3-httplib2}
%description -n python3-httplib2
Small, fast HTTP client library for Python.
%endif
%prep
%autosetup -n httplib2-%{version} -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%py2_install
%if 0%{?with_python3}
pushd %{py3dir}
%py3_install
popd
%endif
%files -n python2-httplib2
%defattr(-,root,root)
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-httplib2
%defattr(-,root,root)
%{python3_sitelib}/*
%endif
%changelog
* Wed Dec 27 2023 fandehui <fandehui@xfusion.com> - 0.19.0-3
- Use mock from the standard library
* Wed Mar 31 2021 zhangjiapeng <zhangjiapeng9@huawei.com> - 0.19.0-2
- python3-httplib2 provides python-httplib2
* Tue Mar 2 2021 zhanghua <zhanghua40@huawei.com> - 0.19.0-1
- update to 0.19.0 to fix CVE-2021-21240
* Mon Jul 20 2020 wangxiao <wangxiao65@huawei.com> - 0.13.1-5
- add yaml file
- fix CVE-2020-11078
* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.13.1-4
- Delete the useless patch
* Fri Jan 10 2020 gulining <gulining1@huawei.com> - 0.13.1-3
- Change the URL to a valid one
* Sat Nov 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.13.1-2
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:change the root of install for python3
* Thu Nov 7 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.13.1-1
- Package init