Merge branch 'master' into el6

Conflicts:
	python-requests.spec
This commit is contained in:
Ralph Bean 2013-02-28 12:39:59 -05:00
commit 6f0f8dc865
6 changed files with 251 additions and 23 deletions

View file

@ -1,30 +1,45 @@
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
%if 0%{?fedora}
%global _with_python3 1
%else
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%endif
# Turn off the brp-python-bytecompile script
#%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
Name: python-requests
Version: 0.14.1
Version: 1.1.0
Release: 3%{?dist}
Summary: HTTP library, written in Python, for human beings
License: ISC and MIT
License: ASL 2.0
URL: http://pypi.python.org/pypi/requests
Source0: http://pypi.python.org/packages/source/r/requests/requests-%{version}.tar.gz
# The following patch is a backport and is discussed here:
# https://github.com/fedora-infra/python-fedora/pull/6
Patch0: %{name}-cookie-handling.patch
# Explicitly use the system certificates in ca-certificates.
# https://bugzilla.redhat.com/show_bug.cgi?id=904614
Patch0: python-requests-system-cert-bundle.patch
# Unbundle python-charade (a fork of python-chardet).
# https://bugzilla.redhat.com/show_bug.cgi?id=904623
Patch1: python-requests-system-chardet-not-charade.patch
# Unbundle python-charade (a fork of python-urllib3).
# https://bugzilla.redhat.com/show_bug.cgi?id=904623
Patch2: python-requests-system-urllib3.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-chardet
BuildRequires: python-urllib3
Requires: python-certifi
%if 0%{?fedora}
Requires: python-gevent
%endif
Requires: ca-certificates
Requires: python-chardet
Requires: python-urllib3
%if 0%{?rhel}
BuildRequires: python-ordereddict
Requires: python-ordereddict
%endif
%description
Most existing Python modules for sending HTTP requests are extremely verbose and
@ -35,7 +50,12 @@ designed to make HTTP requests easy for developers.
%if 0%{?_with_python3}
%package -n python3-requests
Summary: HTTP library, written in Python, for human beings
BuildRequires: python3-devel
BuildRequires: python3-devel
BuildRequires: python3-chardet
BuildRequires: python3-urllib3
Requires: python3-chardet
Requires: python3-urllib3
%description -n python3-requests
Most existing Python modules for sending HTTP requests are extremely verbose and
cumbersome. Pythons built-in urllib2 module provides most of the HTTP
@ -43,33 +63,64 @@ capabilities you should need, but the API is thoroughly broken. This library is
designed to make HTTP requests easy for developers.
%endif
%prep
%setup -q -n requests-%{version}
%patch0 -p1 -b .cookies
%patch0 -p1
%patch1 -p1
%patch2 -p1
# Unbundle the certificate bundle from mozilla.
rm -rf requests/cacert.pem
%if 0%{?_with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
%if 0%{?_with_python3}
pushd %{py3dir}
%{__python3} setup.py build
# Unbundle chardet. Patch1 switches usage to system chardet.
rm -rf build/lib/requests/packages/charade
# Unbundle urllib3. Patch1 switches usage to system urllib3.
rm -rf build/lib/requests/packages
popd
%endif
%{__python} setup.py build
# Unbundle chardet. Patch1 switches usage to system chardet.
rm -rf build/lib/requests/packages/charade
# Unbundle urllib3. Patch1 switches usage to system urllib3.
rm -rf build/lib/requests/packages
%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?_with_python3}
PYTHONDONTWRITEBYTECODE=1 %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
#%py_byte_compile %{__python} %{buildroot}%{python3_sitelib}/requests/packages/chardet2
#%py_byte_compile %{__python} %{buildroot}%{python3_sitelib}/requests/packages/oauthlib
#%py_byte_compile %{__python} %{buildroot}%{python3_sitelib}/requests/packages/urllib3
#%py_byte_compile %{__python} %{buildroot}%{python3_sitelib}/requests/*.py
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
popd
%endif
PYTHONDONTWRITEBYTECODE=1 %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
#%py_byte_compile %{__python} %{buildroot}%{python_sitelib}/requests/packages/chardet
#%py_byte_compile %{__python} %{buildroot}%{python_sitelib}/requests/packages/oauthlib
#%py_byte_compile %{__python} %{buildroot}%{python_sitelib}/requests/packages/urllib3
#%py_byte_compile %{__python} %{buildroot}%{python_sitelib}/requests/*.py
#
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
## The tests succeed if run locally, but fail in koji.
## They require an active network connection to query httpbin.org
#%%check
#%%{__python} test_requests.py
#%%if 0%%{?_with_python3}
#pushd %%{py3dir}
#%%{__python3} test_requests.py
#popd
#%%endif
%files
%defattr(-,root,root,-)
%doc NOTICE LICENSE README.rst HISTORY.rst
@ -83,8 +134,34 @@ PYTHONDONTWRITEBYTECODE=1 %{__python} setup.py install -O1 --skip-build --root $
%{python3_sitelib}/requests/
%endif
%changelog
* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-3
- Unbundled python-urllib3. Using system python-urllib3 now.
- Conditionally include python-ordereddict for el6.
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-2
- Unbundled python-charade/chardet. Using system python-chardet now.
- Removed deprecated comments and actions against oauthlib unbundling.
Those are no longer necessary in 1.1.0.
- Added links to bz tickets over Patch declarations.
* Tue Feb 26 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-1
- Latest upstream.
- Relicense to ASL 2.0 with upstream.
- Removed cookie handling patch (fixed in upstream tarball).
- Updated cert unbundling patch to match upstream.
- Added check section, but left it commented out for koji.
* Fri Feb 8 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.14.1-4
- Let brp_python_bytecompile run again, take care of the non-python{2,3} modules
by removing them from the python{,3}-requests package that they did not belong
in.
- Use the certificates in the ca-certificates package instead of the bundled one
+ https://bugzilla.redhat.com/show_bug.cgi?id=904614
- Fix a problem with cookie handling
+ https://bugzilla.redhat.com/show_bug.cgi?id=906924
* Thu Jan 31 2013 Ralph Bean <rbean@redhat.com> 0.14.1-3
- Introduced backport patch to support better cookie handling.