cfe1853
%if 0%{?fedora} >= 13
62fec70
%global with_python3 1
cfe1853
%else
cfe1853
%if 0%{?rhel} >= 7
cfe1853
%global with_python3 1
cfe1853
%endif
cfe1853
%endif
62fec70
bd76499
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
62fec70
bd76499
Name:           python-httplib2
30d4993
Version:        0.7.7
3f910c0
Release:        1%{?dist}
bd76499
Summary:        A comprehensive HTTP client library
bd76499
Group:          System Environment/Libraries
bd76499
License:        MIT
bd76499
URL:            http://code.google.com/p/httplib2/
62fec70
Source0:        http://httplib2.googlecode.com/files/httplib2-%{version}.tar.gz
7dad936
#Patch0:         httplib_py26.diff
5c28c21
Patch1:         %{name}.certfile.patch
5c28c21
Patch2:         %{name}.getCertHost.patch
d773cae
Patch3:         %{name}.rfc2459.patch
bd76499
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
62fec70
BuildRequires:  python-setuptools-devel
62fec70
BuildRequires:  python-devel
62fec70
BuildArch:      noarch
bd76499
62fec70
%if 0%{?with_python3}
62fec70
BuildRequires:  python3-devel
62fec70
%endif # if with_python3
bd76499
bd76499
%description
bd76499
A comprehensive HTTP client library that supports many features left out of
bd76499
other HTTP libraries.
bd76499
62fec70
%if 0%{?with_python3}
62fec70
%package -n python3-httplib2
62fec70
Summary:        A comprehensive HTTP client library
62fec70
Group:          System Environment/Libraries
62fec70
62fec70
%description -n python3-httplib2
62fec70
A comprehensive HTTP client library that supports many features left out of
62fec70
other HTTP libraries.
62fec70
%endif # with_python3
62fec70
bd76499
%prep
bd76499
%setup -q -n httplib2-%{version}
7dad936
#%patch0 -p0 -b .issue39
7dad936
%patch1 -p0 -b .certfile
5c28c21
%patch2 -p0 -b .getCertHost
d773cae
%patch3 -p0 -b .rfc2459
bd76499
62fec70
%if 0%{?with_python3}
62fec70
rm -rf %{py3dir}
62fec70
cp -a . %{py3dir}
62fec70
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
62fec70
%endif # with_python3
62fec70
bd76499
%build
1f71ea2
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
bd76499
62fec70
%if 0%{?with_python3}
62fec70
pushd %{py3dir}
62fec70
%{__python3} setup.py build
62fec70
popd
62fec70
%endif # with_python3
bd76499
bd76499
%install
bd76499
rm -rf $RPM_BUILD_ROOT
bd76499
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
bd76499
62fec70
%if 0%{?with_python3}
62fec70
pushd %{py3dir}
62fec70
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
62fec70
popd
62fec70
%endif # with_python3
62fec70
bd76499
%clean
bd76499
rm -rf $RPM_BUILD_ROOT
bd76499
bd76499
%files
bd76499
%defattr(-,root,root,-)
6aa5a78
%doc README
bd76499
%{python_sitelib}/*
bd76499
62fec70
%if 0%{?with_python3}
62fec70
%files -n python3-httplib2
62fec70
%defattr(-,root,root,-)
62fec70
%doc README
62fec70
%{python3_sitelib}/*
62fec70
%endif # with_python3
62fec70
bd76499
%changelog
30d4993
* Wed Jan 02 2013 Ding-Yi Chen <dchen at redhat.com> - 0.7.7-1
30d4993
- Upstream update to 0.7.7
30d4993
ed3c5f6
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 0.7.4-7
ed3c5f6
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
ed3c5f6
c70a197
* Fri Jul 27 2012 Ding-Yi Chen <dchen at redhat.com> - 0.7.4-6
d773cae
- Fixed Bug 840968 - SSL errors when the site certificate contains
d773cae
  subjectAltName but DNS is not in it
d773cae
8b59e0f
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.4-5
8b59e0f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
8b59e0f
cfe1853
* Fri Jun 22 2012 Ding-Yi Chen <dchen at redhat.com> - 0.7.4-4
cfe1853
- Unify the spec file between EPEL and Fedora.
cfe1853
9e04d3f
* Thu Jun 21 2012 Ding-Yi Chen <dchen at redhat.com> - 0.7.4-3
9e04d3f
- Applied patch suggested by richardfearn@gmail.com regarding issue 208
9e04d3f
- Fixed: Bug 832344 - Certification validation fails due to multiple 'dns' entries in subjectAltName
9e04d3f
1f71ea2
* Fri Jun 01 2012 Ding-Yi Chen <dchen at redhat.com> - 0.7.4-2
1f71ea2
- Upstream update for Fedora
1f71ea2
5c28c21
* Thu May 03 2012 Ding-Yi Chen <dchen at redhat.com> - 0.7.4-1
5c28c21
- Upstream update to 0.7.4
5c28c21
- Applied patch suggested in issue 208
5c28c21
7dad936
* Fri Feb 24 2012 Ding-Yi Chen <dchen at redhat.com> - 0.7.2-1
7dad936
- Upstream update to 0.7.2
7dad936
  Which may fixed http://code.google.com/p/httplib2/issues/detail?id=62
7dad936
  Note this version uses fedora's cert file bundle instead of httplib2
7dad936
  default.
7dad936
e44d0fe
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-6
e44d0fe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
e44d0fe
5c28c21
* Fri Jul 29 2011 Ding-Yi Chen <dchen at redhat.com>  - 0.4.0-5.el6
5e8bb23
- Apply that address python-httplib2 (GoogleCode Hosted) issue 39
5e8bb23
  http://code.google.com/p/httplib2/issues/detail?id=39
5e8bb23
292e1af
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-5
292e1af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
292e1af
3824262
* Wed Aug 25 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6.0-4
3824262
- rebuild with python3.2
3824262
  http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
3824262
632a474
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.0-3
632a474
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
632a474
62fec70
* Tue Apr 20 2010 Tom "spot" Callaway <tcallawa@redhat.com>
62fec70
- minor spec cleanups
62fec70
- enable python3 support
62fec70
5c28c21
* Fri Apr 02 2010 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de> - 0.6.0-1
6aa5a78
- version upgrade (#566721)
6aa5a78
42ace32
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-4
42ace32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
42ace32
7ace2b2
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-3
7ace2b2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
7ace2b2
5bc1dd8
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.4.0-2
5bc1dd8
- Rebuild for Python 2.6
5bc1dd8
5c28c21
* Thu Dec 27 2007 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de> - 0.4.0-1
bd76499
- initial version