2019-09-30 11:15:38 -04:00
|
|
|
%global srcname urllib3
|
|
|
|
|
%bcond_without tests
|
|
|
|
|
|
|
|
|
|
Name: python-%{srcname}
|
2020-12-21 16:49:55 +08:00
|
|
|
Version: 1.25.9
|
2023-10-04 21:56:08 +08:00
|
|
|
Release: 9
|
2019-09-30 11:15:38 -04:00
|
|
|
Summary: Sanity-friendly HTTP client for Python
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://urllib3.readthedocs.io
|
|
|
|
|
Source0: https://github.com/urllib3/urllib3/archive/%{version}/urllib3-%{version}.tar.gz
|
|
|
|
|
Source1: ssl_match_hostname_py3.py
|
|
|
|
|
|
|
|
|
|
BuildArch: noarch
|
2021-05-24 20:20:50 +08:00
|
|
|
Patch0000: set-RECENT_DATE-not-be-older-than-2-years.patch
|
2021-07-05 11:39:54 +08:00
|
|
|
Patch6000: backport-CVE-2021-33503.patch
|
2021-12-04 15:58:56 +08:00
|
|
|
Patch6001: backport-Change-TARPIT_HOST-to-detect-isolated-network.patch
|
|
|
|
|
Patch6002: backport-Do-not-insert-None-into-ConnectionPool-if-it-was-empty.patch
|
2023-01-16 21:38:24 +08:00
|
|
|
Patch6003: backport-add-server_hostname-to-SSL_KEYWORDS.patch
|
|
|
|
|
Patch6004: backport-strip-leading-zeros-form-ports.patch
|
|
|
|
|
Patch6005: backport-fixed-issue-with-port-0-returning-None.patch
|
2023-04-23 20:30:43 +08:00
|
|
|
Patch6006: backport-fix-NRESERVED_PAT-and-_idna_encode.patch
|
2023-10-04 21:56:08 +08:00
|
|
|
Patch6007: CVE-2023-43804.patch
|
2019-09-30 11:15:38 -04:00
|
|
|
|
|
|
|
|
%global _description \
|
|
|
|
|
HTTP library with thread-safe connection pooling, file post support,\
|
|
|
|
|
sanity friendly, and more.
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Python %_description
|
|
|
|
|
|
|
|
|
|
%package -n python2-%{srcname}
|
|
|
|
|
Summary: Sanity-friendly HTTP client for python2
|
|
|
|
|
%{?python_provide:%python_provide python2-urllib3}
|
|
|
|
|
|
|
|
|
|
Requires: ca-certificates python2-six python2-backports-ssl_match_hostname
|
|
|
|
|
Requires: python2-ipaddress python2-pysocks
|
|
|
|
|
|
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
|
|
|
|
|
|
%if %{with tests}
|
2020-12-21 16:49:55 +08:00
|
|
|
BuildRequires: python2-nose python2-coverage python2-mock python2-six python-trustme
|
2019-09-30 11:15:38 -04:00
|
|
|
BuildRequires: python2-pysocks python2-pytest python2-tornado python2-backports-ssl_match_hostname
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%description -n python2-urllib3
|
|
|
|
|
Python2 %_description
|
|
|
|
|
|
|
|
|
|
%package -n python3-%{srcname}
|
|
|
|
|
Summary: Python3 HTTP library with thread-safe connection pooling and file post
|
|
|
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
|
BuildRequires: python3-nose python3-mock python3-six
|
|
|
|
|
BuildRequires: python3-pysocks python3-pytest python3-tornado
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
Requires: ca-certificates python3-six python3-pysocks
|
|
|
|
|
|
|
|
|
|
%description -n python3-urllib3
|
|
|
|
|
Python3 %_description
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -n %{srcname}-%{version} -p1
|
2023-01-05 21:17:02 +08:00
|
|
|
|
|
|
|
|
recent_date=$(date --date "7 month ago" +"%Y, %_m, %_d")
|
|
|
|
|
sed -i "s/^RECENT_DATE = datetime.date(.*)/RECENT_DATE = datetime.date($recent_date)/" src/urllib3/connection.py
|
|
|
|
|
|
2019-09-30 11:15:38 -04:00
|
|
|
#Failure use case circumvention
|
|
|
|
|
rm -rf test/with_dummyserver/
|
|
|
|
|
rm -rf test/appengine/
|
|
|
|
|
rm -rf test/contrib/
|
|
|
|
|
rm -rf test/test_no_ssl.py
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%py2_build
|
|
|
|
|
%py3_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%py2_install
|
|
|
|
|
%py3_install
|
|
|
|
|
|
|
|
|
|
rm -rf %{buildroot}%{python2_sitelib}/urllib3/packages/six.py*
|
|
|
|
|
rm -rf %{buildroot}%{python2_sitelib}/urllib3/packages/ssl_match_hostname/
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/%{python2_sitelib}/urllib3/packages/
|
|
|
|
|
ln -s %{python2_sitelib}/six.py %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py
|
|
|
|
|
ln -s %{python2_sitelib}/six.pyc %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyc
|
|
|
|
|
ln -s %{python2_sitelib}/six.pyo %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyo
|
|
|
|
|
ln -s %{python2_sitelib}/backports/ssl_match_hostname %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname
|
|
|
|
|
|
|
|
|
|
rm -rf %{buildroot}%{python3_sitelib}/urllib3/packages/six.py*
|
|
|
|
|
rm -rf %{buildroot}%{python3_sitelib}/urllib3/packages/__pycache__/six*
|
|
|
|
|
rm -rf %{buildroot}%{python3_sitelib}/urllib3/packages/ssl_match_hostname/
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/
|
|
|
|
|
cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
|
|
|
|
|
ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
|
|
|
|
|
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
|
|
|
|
|
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
|
|
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
|
%check
|
2021-05-24 20:20:50 +08:00
|
|
|
#we don't have python2-trustme,so we don't need check python2
|
|
|
|
|
#PYTHONPATH=%{buildroot}%{python2_sitelib}:%{python2_sitelib} %{__python2} -m pytest -v
|
2019-09-30 11:15:38 -04:00
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} %{__python3} -m pytest -v
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files -n python2-urllib3
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%license LICENSE.txt
|
|
|
|
|
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
|
|
|
|
|
%{python2_sitelib}/urllib3/
|
|
|
|
|
%{python2_sitelib}/urllib3-*.egg-info
|
|
|
|
|
|
|
|
|
|
%files -n python3-urllib3
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%license LICENSE.txt
|
|
|
|
|
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
|
|
|
|
|
%{python3_sitelib}/urllib3/
|
|
|
|
|
%{python3_sitelib}/urllib3-*.egg-info
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-10-04 21:56:08 +08:00
|
|
|
* Wed Oct 04 2023 Funda Wang <fundawang@yeah.net> - 1.25.9-9
|
|
|
|
|
- fix CVE-2023-43804
|
|
|
|
|
|
2023-04-23 20:30:43 +08:00
|
|
|
* Sun Apr 23 2023 xzf1244 <xzff@hust.edu.cn> - 1.25.9-8
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- CVE:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:fix field NRESERVED_PAT and function _idna_encode that will cause bugs
|
|
|
|
|
|
2023-01-19 14:26:54 +08:00
|
|
|
* Thu Jan 19 2023 chenhaixing <chenhaixing@huawei.com> - 1.25.9-7
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- CVE:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:modify HOST_PORT_PAT in backport-fixed-issue-with-port-0-returning-None.patch
|
|
|
|
|
|
2023-01-16 21:38:24 +08:00
|
|
|
* Mon Jan 16 2023 chenhaixing <chenhaixing@huawei.com> - 1.25.9-6
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- CVE:NA
|
|
|
|
|
- SUG:NA
|
2023-01-19 14:26:54 +08:00
|
|
|
- DESC:fix parse port error and add server_hostname to SSL_KEYWORDS
|
2023-01-16 21:38:24 +08:00
|
|
|
|
2023-01-05 21:17:02 +08:00
|
|
|
* Thu Jan 5 2023 chenhaixing <chenhaixing@huawei.com> - 1.25.9-5
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- CVE:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:modify RECENT_DATE in python-urllib3.spec to adapt time change
|
|
|
|
|
|
2021-12-04 15:58:56 +08:00
|
|
|
* Sat Dec 04 2021 chxssg <chxssg@qq.com> - 1.25.9-4
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- CVE:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:do not insert none into connectionpool when it is empty
|
|
|
|
|
|
|
|
|
|
* Mon Jul 05 2021 zhanzhimin <zhanzhimin@huawei.com> - 1.25.9-3
|
2021-07-05 11:39:54 +08:00
|
|
|
- fix CVE-2021-33503
|
|
|
|
|
|
2021-12-04 15:58:56 +08:00
|
|
|
* Mon May 24 2021 sunguoshuai<sunguoshuai@huawei.com> - 1.25.9-2
|
2021-05-24 20:20:50 +08:00
|
|
|
- fix check error by set RECENT_DATE
|
|
|
|
|
|
2021-12-04 15:58:56 +08:00
|
|
|
* Wed Nov 25 2020 leiju<leiju4@huawei.com> - 1.25.9-1
|
2020-12-21 16:49:55 +08:00
|
|
|
- upgrade to 1.25.9
|
|
|
|
|
|
2019-11-06 19:50:44 +08:00
|
|
|
* Sat Oct 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.24.3-2
|
|
|
|
|
- optimize spec file.
|
|
|
|
|
|
2019-09-30 11:15:38 -04:00
|
|
|
* Mon Sep 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.24.3-1
|
|
|
|
|
- Package init
|