ad43998
%if 0%{?fedora}
b5609c6
%global _with_python3 1
b5609c6
%else
b5609c6
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
b5609c6
%endif
e0d81d7
Name:           python-requests
e9f9b2b
Version:        0.14.1
ad43998
Release:        4%{?dist}
e0d81d7
Summary:        HTTP library, written in Python, for human beings
e0d81d7
afda359
License:        ISC and MIT
e0d81d7
URL:            http://pypi.python.org/pypi/requests
e0d81d7
Source0:        http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz
ad43998
# Separate response cookies from request cookies discussed here:
ad43998
# https://github.com/fedora-infra/python-fedora/pull/6
ad43998
Patch0: python-requests-cookie-handling.patch
ad43998
# Use the system certificates in ca-certificates.  This patch causes util.py
ad43998
# to search for the system bundle (whereas now the return value of
ad43998
# certs.where() causes it to always use the bundled version.
ad43998
Patch1: python-requests-system-cert-bundle.patch
e0d81d7
BuildArch:      noarch
e9f9b2b
BuildRequires:  python2-devel
b5609c6
74db89b
Requires:       ca-certificates
e0d81d7
e0d81d7
%description
e0d81d7
Most existing Python modules for sending HTTP requests are extremely verbose and 
e0d81d7
cumbersome. Python’s built-in urllib2 module provides most of the HTTP 
e0d81d7
capabilities you should need, but the API is thoroughly broken. This library is 
e0d81d7
designed to make HTTP requests easy for developers.
e0d81d7
b5609c6
%if 0%{?_with_python3}
b5609c6
%package -n python3-requests
b5609c6
Summary: HTTP library, written in Python, for human beings
b5609c6
BuildRequires: python3-devel
b5609c6
%description -n python3-requests
b5609c6
Most existing Python modules for sending HTTP requests are extremely verbose and
b5609c6
cumbersome. Python’s built-in urllib2 module provides most of the HTTP
b5609c6
capabilities you should need, but the API is thoroughly broken. This library is
b5609c6
designed to make HTTP requests easy for developers.
b5609c6
%endif
b5609c6
e0d81d7
e0d81d7
%prep
e0d81d7
%setup -q -n requests-%{version}
e0d81d7
ad43998
%patch0 -p1
ad43998
%patch1 -p1
ad43998
ad43998
### TODO: Need to unbundle libraries in the packages directory.
ad43998
### https://bugzilla.redhat.com/show_bug.cgi?id=904623
ad43998
### Priority urllib3 since it's still bundled in requests-1.0.x
ad43998
### And it's a security issue:
ad43998
### https://bugzilla.redhat.com/show_bug.cgi?id=855322
ad43998
### https://bugzilla.redhat.com/show_bug.cgi?id=855323
ad43998
### Review request for urllib3:
ad43998
### https://bugzilla.redhat.com/show_bug.cgi?id=907688
ad43998
### chardet/2 is available as python-chardet and python3-chardet so
ad43998
### those may be easy to unbundle as well (will need patching, but looks 
ad43998
### like a single file, compat.py)
ad43998
### oauthlib isn't packaged yet (and not in requests-1.0.0)
ad43998
### but the code in requests will already prefer the system version to
ad43998
### the bundled version
ad43998
ad43998
# Unbundle the certificate bundle from mozilla.
ad43998
rm -rf requests/cacert.pem
ad43998
ad43998
%if 0%{?_with_python3}
ad43998
rm -rf %{py3dir}
ad43998
cp -a . %{py3dir}
ad43998
%endif # with_python3
ad43998
ad43998
e0d81d7
%build
b5609c6
%if 0%{?_with_python3}
ad43998
pushd %{py3dir}
ad43998
rm -rf requests/packages/chardet
ad43998
# Note -- this means that requests.auth.OAuth1 won't work in py3.
ad43998
# But, as there isn't an oauthlib for py3, this didn't work anyway.
ad43998
# Could patch upstream's code to be more explicit about this but
ad43998
# requests-1.0.x dropped this functionality anyway
ad43998
rm -rf requests/packages/oauthlib
b5609c6
%{__python3} setup.py build
ad43998
popd
b5609c6
%endif
ad43998
ad43998
rm -rf requests/packages/chardet2
e9f9b2b
%{__python} setup.py build
e0d81d7
e0d81d7
%install
e0d81d7
rm -rf $RPM_BUILD_ROOT
b5609c6
%if 0%{?_with_python3}
ad43998
pushd %{py3dir}
ad43998
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
ad43998
popd
b5609c6
%endif
e0d81d7
ad43998
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
ad43998
e0d81d7
%files
804f3bb
%defattr(-,root,root,-)
afda359
%doc NOTICE LICENSE README.rst HISTORY.rst
e0d81d7
%{python_sitelib}/*.egg-info
e0d81d7
%dir %{python_sitelib}/requests
afda359
%{python_sitelib}/requests/*
e0d81d7
b5609c6
%if 0%{?_with_python3}
b5609c6
%files -n python3-requests
b5609c6
%{python3_sitelib}/*.egg-info
b5609c6
%{python3_sitelib}/requests/
b5609c6
%endif
b5609c6
e0d81d7
e0d81d7
%changelog
4d0266e
* Fri Feb  8 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.14.1-4
ad43998
- Let brp_python_bytecompile run again, take care of the non-python{2,3} modules
ad43998
  by removing them from the python{,3}-requests package that they did not belong
ad43998
  in.
ad43998
- Use the certificates in the ca-certificates package instead of the bundled one
ad43998
  + https://bugzilla.redhat.com/show_bug.cgi?id=904614
ad43998
- Fix a problem with cookie handling
ad43998
  + https://bugzilla.redhat.com/show_bug.cgi?id=906924
ad43998
e9f9b2b
* Wed Oct 22 2012 Arun S A G <sagarun@gmail.com>  0.14.1-1
e9f9b2b
- Updated to latest upstream release
f0e2277
74db89b
* Sun Jun 10 2012 Arun S A G <sagarun@gmail.com> 0.13.1-1
74db89b
- Updated to latest upstream release 0.13.1
74db89b
- Use system provided ca-certificates
74db89b
- No more async requests use grrequests https://github.com/kennethreitz/grequests
74db89b
- Remove gevent as it is no longer required by requests
d38a7df
d30532a
* Sun Apr 01 2012 Arun S A G <sagarun@gmail.com> 0.11.1-1
d30532a
- Updated to upstream release 0.11.1
d30532a
b5609c6
* Thu Mar 29 2012 Arun S A G <sagarun@gmail.com> 0.10.6-3
b5609c6
- Support building package for EL6
b5609c6
b5609c6
* Tue Mar 27 2012 Rex Dieter <rdieter@fedoraproject.org> 0.10.6-2
b5609c6
- +python3-requests pkg
b5609c6
afda359
* Sat Mar 3 2012 Arun SAG <sagarun@gmail.com> - 0.10.6-1
afda359
- Updated to new upstream version
afda359
804f3bb
* Sat Jan 21 2012 Arun SAG <sagarun@gmail.com> - 0.9.3-1
804f3bb
- Updated to new upstream version 0.9.3
804f3bb
- Include python-gevent as a dependency for requests.async
804f3bb
- Clean up shebangs in requests/setup.py,test_requests.py and test_requests_ext.py
804f3bb
f8b659f
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-2
f8b659f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f8b659f
67a4111
* Sun Nov 27 2011 Arun SAG <sagarun@gmail.com> - 0.8.2-1
67a4111
- New upstream version
67a4111
- keep alive support
67a4111
- complete removal of cookiejar and urllib2
67a4111
06f0a42
* Thu Nov 10 2011 Arun SAG <sagarun@gmail.com> - 0.7.6-1
06f0a42
- Updated to new upstream release 0.7.6
06f0a42
f373c2c
* Thu Oct 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.6-1
f373c2c
- Updated to version 0.6.6
f373c2c
b54eb0d
* Fri Aug 26 2011 Arun SAG <sagarun@gmail.com> - 0.6.1-1
b54eb0d
- Updated to version 0.6.1
b54eb0d
d4477a1
* Sat Aug 20 2011 Arun SAG <sagarun@gmail.com> - 0.6.0-1
d4477a1
- Updated to latest version 0.6.0
d4477a1
e0d81d7
* Mon Aug 15 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-2
e0d81d7
- Remove OPT_FLAGS from build section since it is a noarch package
e0d81d7
- Fix use of mixed tabs and space
e0d81d7
- Remove extra space around the word cumbersome in description
e0d81d7
e0d81d7
* Sun Aug 14 2011 Arun SAG <sagarun@gmail.com> - 0.5.1-1
e0d81d7
- Initial package