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
9d1befd
e0d81d7
Name:           python-requests
9d1befd
Version:        1.1.0
7fe5b10
Release:        2%{?dist}
e0d81d7
Summary:        HTTP library, written in Python, for human beings
e0d81d7
9d1befd
License:        ASL 2.0
e0d81d7
URL:            http://pypi.python.org/pypi/requests
e0d81d7
Source0:        http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz
9d1befd
# Explicitly use the system certificates in ca-certificates.
7fe5b10
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
9d1befd
Patch0:         python-requests-system-cert-bundle.patch
7fe5b10
# Unbundle python-charade (a fork of python-chardet).
7fe5b10
# https://bugzilla.redhat.com/show_bug.cgi?id=904623
7fe5b10
Patch1:         python-requests-system-chardet-not-charade.patch
7fe5b10
e0d81d7
BuildArch:      noarch
e9f9b2b
BuildRequires:  python2-devel
7fe5b10
BuildRequires:  python-chardet
b5609c6
74db89b
Requires:       ca-certificates
7fe5b10
Requires:       python-chardet
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
7fe5b10
BuildRequires:  python3-devel
7fe5b10
BuildRequires:  python3-chardet
7fe5b10
Requires:       python3-chardet
7fe5b10
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
7fe5b10
%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
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
e0d81d7
%build
b5609c6
%if 0%{?_with_python3}
ad43998
pushd %{py3dir}
b5609c6
%{__python3} setup.py build
7fe5b10
7fe5b10
# Unbundle chardet.  Patch1 switches usage to system chardet.
7fe5b10
rm -rf build/lib/requests/packages/charade
7fe5b10
ad43998
popd
b5609c6
%endif
ad43998
e9f9b2b
%{__python} setup.py build
e0d81d7
7fe5b10
# Unbundle chardet.  Patch1 switches usage to system chardet.
7fe5b10
rm -rf build/lib/requests/packages/charade
7fe5b10
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
9d1befd
## The tests succeed if run locally, but fail in koji.
9d1befd
## They require an active network connection to query httpbin.org
9d1befd
#%%check
9d1befd
#%%{__python} test_requests.py
9d1befd
#%%if 0%%{?_with_python3}
9d1befd
#pushd %%{py3dir}
9d1befd
#%%{__python3} test_requests.py
9d1befd
#popd
9d1befd
#%%endif
9d1befd
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
7fe5b10
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-2
7fe5b10
- Unbundled python-charade/chardet.  Using system python-chardet now.
7fe5b10
- Removed deprecated comments and actions against oauthlib unbundling.
7fe5b10
  Those are no longer necessary in 1.1.0.
7fe5b10
- Added links to bz tickets over Patch declarations.
7fe5b10
9d1befd
* Tue Feb 26 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-1
9d1befd
- Latest upstream.
9d1befd
- Relicense to ASL 2.0 with upstream.
9d1befd
- Removed cookie handling patch (fixed in upstream tarball).
9d1befd
- Updated cert unbundling patch to match upstream.
9d1befd
- Added check section, but left it commented out for koji.
9d1befd
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