dbd2ef
%if 0%{?fedora}
dbd2ef
%global _with_python3 1
dbd2ef
%else
dbd2ef
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
dbd2ef
%endif
dbd2ef
dbd2ef
Name:           python-requests
dbd2ef
Version:        2.6.0
dbd2ef
Release:        6%{?dist}
dbd2ef
Summary:        HTTP library, written in Python, for human beings
dbd2ef
dbd2ef
License:        ASL 2.0
dbd2ef
URL:            http://pypi.python.org/pypi/requests
dbd2ef
Source0:        http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz
dbd2ef
# Explicitly use the system certificates in ca-certificates.
dbd2ef
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
dbd2ef
Patch0:         python-requests-system-cert-bundle.patch
dbd2ef
dbd2ef
# Remove an unnecessary reference to a bundled compat lib in urllib3
dbd2ef
Patch1:         python-requests-remove-nested-bundling-dep.patch
dbd2ef
dbd2ef
# Fix for CVE-2018-18074
dbd2ef
# Resolved upstream: https://github.com/requests/requests/pull/4718
dbd2ef
Patch2:         fix-CVE-2018-18074.patch
dbd2ef
dbd2ef
# Fix handling of default ports in auth stripping
dbd2ef
# Resolved upstream: https://github.com/psf/requests/pull/4851
dbd2ef
Patch3: fix-default-port-handling.patch
dbd2ef
dbd2ef
BuildArch:      noarch
dbd2ef
BuildRequires:  python2-devel
dbd2ef
BuildRequires:  python-chardet >= 2.2.1-1
dbd2ef
BuildRequires:  python-urllib3 >= 1.10.2-1
dbd2ef
dbd2ef
Requires:       ca-certificates
dbd2ef
Requires:       python-chardet >= 2.2.1-1
dbd2ef
Requires:       python-urllib3 >= 1.10.2-1
dbd2ef
dbd2ef
%if 0%{?rhel} && 0%{?rhel} <= 6
dbd2ef
BuildRequires:  python-ordereddict >= 1.1
dbd2ef
Requires:       python-ordereddict >= 1.1
dbd2ef
%endif
dbd2ef
dbd2ef
Provides:       python2-requests = %{version}-%{release}
dbd2ef
Obsoletes:      python2-requests < %{version}-%{release}
dbd2ef
dbd2ef
%description
dbd2ef
Most existing Python modules for sending HTTP requests are extremely verbose and 
dbd2ef
cumbersome. Python’s built-in urllib2 module provides most of the HTTP 
dbd2ef
capabilities you should need, but the API is thoroughly broken. This library is 
dbd2ef
designed to make HTTP requests easy for developers.
dbd2ef
dbd2ef
%if 0%{?_with_python3}
dbd2ef
%package -n python3-requests
dbd2ef
Summary: HTTP library, written in Python, for human beings
dbd2ef
BuildRequires:  python3-devel
dbd2ef
BuildRequires:  python3-chardet
dbd2ef
BuildRequires:  python3-urllib3
dbd2ef
Requires:       python3-chardet
dbd2ef
Requires:       python3-urllib3
dbd2ef
dbd2ef
%description -n python3-requests
dbd2ef
Most existing Python modules for sending HTTP requests are extremely verbose and
dbd2ef
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
dbd2ef
capabilities you should need, but the API is thoroughly broken. This library is
dbd2ef
designed to make HTTP requests easy for developers.
dbd2ef
%endif
dbd2ef
dbd2ef
%prep
dbd2ef
%setup -q -n requests-%{version}
dbd2ef
dbd2ef
%patch0 -p1
dbd2ef
%patch1 -p1
dbd2ef
%patch2 -p1
dbd2ef
%patch3 -p1
dbd2ef
dbd2ef
# Unbundle the certificate bundle from mozilla.
dbd2ef
rm -rf requests/cacert.pem
dbd2ef
dbd2ef
%if 0%{?_with_python3}
dbd2ef
rm -rf %{py3dir}
dbd2ef
cp -a . %{py3dir}
dbd2ef
%endif # with_python3
dbd2ef
dbd2ef
%build
dbd2ef
%if 0%{?_with_python3}
dbd2ef
pushd %{py3dir}
dbd2ef
%{__python3} setup.py build
dbd2ef
dbd2ef
# Unbundle chardet and urllib3.
dbd2ef
rm -rf build/lib/requests/packages/chardet
dbd2ef
rm -rf build/lib/requests/packages/urllib3
dbd2ef
dbd2ef
popd
dbd2ef
%endif
dbd2ef
dbd2ef
%py2_build
dbd2ef
dbd2ef
# Unbundle chardet and urllib3.
dbd2ef
rm -rf build/lib/requests/packages/chardet
dbd2ef
rm -rf build/lib/requests/packages/urllib3
dbd2ef
dbd2ef
%install
dbd2ef
rm -rf $RPM_BUILD_ROOT
dbd2ef
%if 0%{?_with_python3}
dbd2ef
pushd %{py3dir}
dbd2ef
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
dbd2ef
popd
dbd2ef
%endif
dbd2ef
dbd2ef
%py2_install
dbd2ef
dbd2ef
## The tests succeed if run locally, but fail in koji.
dbd2ef
## They require an active network connection to query httpbin.org
dbd2ef
#%%check
dbd2ef
#%%{__python} test_requests.py
dbd2ef
#%%if 0%%{?_with_python3}
dbd2ef
#pushd %%{py3dir}
dbd2ef
#%%{__python3} test_requests.py
dbd2ef
#popd
dbd2ef
#%%endif
dbd2ef
dbd2ef
%files
dbd2ef
%defattr(-,root,root,-)
dbd2ef
%doc NOTICE LICENSE README.rst HISTORY.rst
dbd2ef
%{python2_sitelib}/*.egg-info
dbd2ef
%dir %{python2_sitelib}/requests
dbd2ef
%{python2_sitelib}/requests/*
dbd2ef
dbd2ef
%if 0%{?_with_python3}
dbd2ef
%files -n python3-requests
dbd2ef
%{python3_sitelib}/*.egg-info
dbd2ef
%{python3_sitelib}/requests/
dbd2ef
%endif
dbd2ef
dbd2ef
%changelog
dbd2ef
* Tue Aug 27 2019 Charalampos Stratakis <cstratak@redhat.com> - 2.6.0-6
dbd2ef
- Fix handling of default ports in auth stripping
dbd2ef
Resolves: rhbz#1745417
dbd2ef
dbd2ef
* Mon Nov 26 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.6.0-5
dbd2ef
- Fix CVE-2018-18074
dbd2ef
Resolves: rhbz#1647368
dbd2ef
dbd2ef
* Wed Jun 03 2015 Matej Stuchlik <mstuchli@redhat.com> - 2.6.0-1
dbd2ef
- Update to 2.6.0
dbd2ef
Resolves: rhbz#1214365
dbd2ef
dbd2ef
* Mon Jan 12 2015 Endi S. Dewata <edewata@redhat.com> - 1.1.0-9
dbd2ef
- Merged headers with different cases.
dbd2ef
dbd2ef
* Mon Jan 27 2014 Endi S. Dewata <edewata@redhat.com> - 1.1.0-8
dbd2ef
- Removed authentication header on redirect.
dbd2ef
dbd2ef
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.1.0-7
dbd2ef
- Mass rebuild 2013-12-27
dbd2ef
dbd2ef
* Fri Oct  4 2013 Endi S. Dewata <edewata@redhat.com> - 1.1.0-6
dbd2ef
- Removed bundled packages.
dbd2ef
dbd2ef
* Tue Jun 18 2013 Endi S. Dewata <edewata@redhat.com> - 1.1.0-5
dbd2ef
- Fixed bogus date in changelog entry.
dbd2ef
dbd2ef
* Tue Jun 11 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-4
dbd2ef
- Correct a rhel conditional on python-ordereddict
dbd2ef
dbd2ef
* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-3
dbd2ef
- Unbundled python-urllib3.  Using system python-urllib3 now.
dbd2ef
- Conditionally include python-ordereddict for el6.
dbd2ef
dbd2ef
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-2
dbd2ef
- Unbundled python-charade/chardet.  Using system python-chardet now.
dbd2ef
- Removed deprecated comments and actions against oauthlib unbundling.
dbd2ef
  Those are no longer necessary in 1.1.0.
dbd2ef
- Added links to bz tickets over Patch declarations.
dbd2ef
dbd2ef
* Tue Feb 26 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-1
dbd2ef
- Latest upstream.
dbd2ef
- Relicense to ASL 2.0 with upstream.
dbd2ef
- Removed cookie handling patch (fixed in upstream tarball).
dbd2ef
- Updated cert unbundling patch to match upstream.
dbd2ef
- Added check section, but left it commented out for koji.
dbd2ef
dbd2ef
* Fri Feb  8 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.14.1-4
dbd2ef
- Let brp_python_bytecompile run again, take care of the non-python{2,3} modules
dbd2ef
  by removing them from the python{,3}-requests package that they did not belong
dbd2ef
  in.
dbd2ef
- Use the certificates in the ca-certificates package instead of the bundled one
dbd2ef
  + https://bugzilla.redhat.com/show_bug.cgi?id=904614
dbd2ef
- Fix a problem with cookie handling
dbd2ef
  + https://bugzilla.redhat.com/show_bug.cgi?id=906924
dbd2ef
dbd2ef
* Mon Oct 22 2012 Arun S A G <sagarun@gmail.com>  0.14.1-1
dbd2ef
- Updated to latest upstream release
dbd2ef
dbd2ef
* Sun Jun 10 2012 Arun S A G <sagarun@gmail.com> 0.13.1-1
dbd2ef
- Updated to latest upstream release 0.13.1
dbd2ef
- Use system provided ca-certificates
dbd2ef
- No more async requests use grrequests https://github.com/kennethreitz/grequests
dbd2ef
- Remove gevent as it is no longer required by requests
dbd2ef
dbd2ef
* Sun Apr 01 2012 Arun S A G <sagarun@gmail.com> 0.11.1-1
dbd2ef
- Updated to upstream release 0.11.1
dbd2ef
dbd2ef
* Thu Mar 29 2012 Arun S A G <sagarun@gmail.com> 0.10.6-3
dbd2ef
- Support building package for EL6
dbd2ef
dbd2ef
* Tue Mar 27 2012 Rex Dieter <rdieter@fedoraproject.org> 0.10.6-2
dbd2ef
- +python3-requests pkg
dbd2ef
dbd2ef
* Sat Mar 3 2012 Arun SAG <sagarun@gmail.com> - 0.10.6-1
dbd2ef
- Updated to new upstream version
dbd2ef
dbd2ef
* Sat Jan 21 2012 Arun SAG <sagarun@gmail.com> - 0.9.3-1
dbd2ef
- Updated to new upstream version 0.9.3
dbd2ef
- Include python-gevent as a dependency for requests.async
dbd2ef
- Clean up shebangs in requests/setup.py,test_requests.py and test_requests_ext.py
dbd2ef
dbd2ef
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-2
dbd2ef
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
dbd2ef
dbd2ef
* Sun Nov 27 2011 Arun SAG <sagarun@gmail.com> - 0.8.2-1
dbd2ef
- New upstream version
dbd2ef
- keep alive support
dbd2ef
- complete removal of cookiejar and urllib2
dbd2ef
dbd2ef
* Thu Nov 10 2011 Arun SAG <sagarun@gmail.com> - 0.7.6-1
dbd2ef
- Updated to new upstream release 0.7.6
dbd2ef
dbd2ef
* Thu Oct 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.6-1
dbd2ef
- Updated to version 0.6.6
dbd2ef
dbd2ef
* Fri Aug 26 2011 Arun SAG <sagarun@gmail.com> - 0.6.1-1
dbd2ef
- Updated to version 0.6.1
dbd2ef
dbd2ef
* Sat Aug 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.0-1
dbd2ef
- Updated to latest version 0.6.0
dbd2ef
dbd2ef
* Mon Aug 15 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-2
dbd2ef
- Remove OPT_FLAGS from build section since it is a noarch package
dbd2ef
- Fix use of mixed tabs and space
dbd2ef
- Remove extra space around the word cumbersome in description
dbd2ef
dbd2ef
* Sun Aug 14 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-1
dbd2ef
- Initial package