e2c2602
%global srcname urllib3
e2c2602
e2c2602
Name:           python-%{srcname}
a103d65
Version:        1.20
821ff06
Release:        1%{?dist}
e2c2602
Summary:        Python HTTP library with thread-safe connection pooling and file post
e2c2602
e2c2602
License:        MIT
821ff06
URL:            https://github.com/shazow/urllib3
821ff06
Source0:        %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
821ff06
# Used with Python 3.5+
a641ca8
Source1:        ssl_match_hostname_py3.py
e2c2602
BuildArch:      noarch
e2c2602
bc86150
%description
bc86150
Python HTTP module with connection pooling and file POST abilities.
bc86150
bc86150
%package -n python2-%{srcname}
bc86150
Summary:        Python2 HTTP library with thread-safe connection pooling and file post
bc86150
%{?python_provide:%python_provide python2-%{srcname}}
bc86150
e2c2602
Requires:       ca-certificates
e2c2602
f611c7a
# Previously bundled things:
f611c7a
Requires:       python-six
821ff06
Requires:       python-backports-ssl_match_hostname
821ff06
821ff06
# Secure extra requirements
821ff06
Requires:       python2-pyOpenSSL
821ff06
Requires:       python-cryptography
821ff06
Requires:       python-idna
821ff06
Requires:       python-ipaddress
0597377
Requires:       python-pysocks
0597377
e2c2602
BuildRequires:  python2-devel
e2c2602
# For unittests
e2c2602
BuildRequires:  python-nose
821ff06
BuildRequires:  python-nose-exclude
821ff06
BuildRequires:  python-coverage
4a646b9
BuildRequires:  python-mock
e2c2602
BuildRequires:  python-six
a103d65
BuildRequires:  python-psutil
0597377
BuildRequires:  python-pysocks
f611c7a
BuildRequires:  python-tornado
e2c2602
bc86150
%description -n python2-%{srcname}
bc86150
Python2 HTTP module with connection pooling and file POST abilities.
bc86150
821ff06
821ff06
%package -n python3-%{srcname}
bc86150
Summary:        Python3 HTTP library with thread-safe connection pooling and file post
bc86150
821ff06
BuildRequires:  python3-devel
e2c2602
# For unittests
821ff06
BuildRequires:  python3-nose
821ff06
BuildRequires:  python3-mock
821ff06
BuildRequires:  python3-six
821ff06
BuildRequires:  python3-pysocks
a103d65
BuildRequires:  python3-psutil
821ff06
BuildRequires:  python3-tornado
0597377
0597377
Requires:       ca-certificates
821ff06
Requires:       python3-six
821ff06
Requires:       python3-pysocks
821ff06
Requires:       python3-pyOpenSSL
821ff06
Requires:       python3-cryptography
821ff06
Requires:       python3-idna
821ff06
Requires:       python3-pysocks
821ff06
821ff06
%description -n python3-%{srcname}
e2c2602
Python3 HTTP module with connection pooling and file POST abilities.
e2c2602
e2c2602
e2c2602
%prep
a8898e4
%setup -q -n %{srcname}-%{version}
b73a1a9
# Drop the dummyserver tests in koji.  They fail there in real builds, but not
b73a1a9
# in scratch builds (weird).
b73a1a9
rm -rf test/with_dummyserver/
821ff06
# Lots of these tests started failing, even for old versions, so it has something
821ff06
# to do with Fedora in particular. They don't fail in upstream build infrastructure
821ff06
rm -rf test/contrib/
a1d2b32
e2c2602
%build
821ff06
%py2_build
821ff06
%py3_build
e2c2602
e2c2602
e2c2602
%install
821ff06
%py2_install
821ff06
%py3_install
f611c7a
821ff06
# Unbundle the Python 2 build
f611c7a
rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py*
f611c7a
rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname/
f611c7a
f611c7a
mkdir -p %{buildroot}/%{python2_sitelib}/urllib3/packages/
f611c7a
ln -s ../../six.py %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py
7e15819
ln -s ../../six.pyc %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyc
7e15819
ln -s ../../six.pyo %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyo
762324a
f611c7a
ln -s ../../backports/ssl_match_hostname %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname
e2c2602
821ff06
# Unbundle the Python 3 build
f611c7a
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py*
f611c7a
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/
f611c7a
f611c7a
mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/
f611c7a
ln -s ../../six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
821ff06
# urllib3 requires Python 3.5 to use the standard library's match_hostname,
821ff06
# which we ship in Fedora 26, so we can safely replace the bundled version with
821ff06
# this stub which imports the necessary objects.
a641ca8
cp %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
f611c7a
f611c7a
# Copy in six.py just for the test suite.
821ff06
cp %{python2_sitelib}/six.* %{buildroot}/%{python2_sitelib}/.
f611c7a
cp %{python3_sitelib}/six.* %{buildroot}/%{python3_sitelib}/.
f611c7a
e2c2602
e2c2602
%check
e2c2602
nosetests
821ff06
nosetests-%{python3_version}
e2c2602
f611c7a
# And after its done, remove our copied in bits
f611c7a
rm -rf %{buildroot}/%{python2_sitelib}/six*
f611c7a
rm -rf %{buildroot}/%{python2_sitelib}/backports*
f611c7a
rm -rf %{buildroot}/%{python3_sitelib}/six*
f611c7a
rm -rf %{buildroot}/%{python3_sitelib}/__pycache__*
821ff06
e2c2602
bc86150
%files -n python2-%{srcname}
149e0ed
%license LICENSE.txt
149e0ed
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
f611c7a
%{python2_sitelib}/urllib3/
f611c7a
%{python2_sitelib}/urllib3-*.egg-info
e2c2602
821ff06
821ff06
%files -n python3-%{srcname}
149e0ed
%license LICENSE.txt
821ff06
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
f611c7a
%{python3_sitelib}/urllib3/
f611c7a
%{python3_sitelib}/urllib3-*.egg-info
821ff06
e2c2602
e2c2602
%changelog
a103d65
* Wed Jan 25 2017 Jeremy Cline <jeremy@jcline.org> - 1.20.0-1
a103d65
- Update to 1.20.0 (#1414775)
a103d65
821ff06
* Thu Nov 17 2016 Jeremy Cline <jeremy@jcline.org> 1.19.1-1
821ff06
- Update to 1.19.1
821ff06
- Clean up the specfile to only support Fedora 26
821ff06
66b4499
* Wed Aug 10 2016 Kevin Fenzi <kevin@scrye.com> - 1.16-3
66b4499
- Rebuild now that python-requests is ready to update.
66b4499
57ee1a8
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.16-2
57ee1a8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
57ee1a8
0731463
* Wed Jun 15 2016 Kevin Fenzi <kevin@scrye.com> - 1.16-1
0731463
- Update to 1.16
0731463
bc86150
* Thu Jun 02 2016 Ralph Bean <rbean@redhat.com> - 1.15.1-3
bc86150
- Create python2 subpackage to comply with guidelines.
bc86150
646b329
* Wed Jun 01 2016 Ralph Bean <rbean@redhat.com> - 1.15.1-2
646b329
- Remove broken symlinks to unbundled python3-six files
646b329
  https://bugzilla.redhat.com/show_bug.cgi?id=1295015
646b329
0597377
* Fri Apr 29 2016 Ralph Bean <rbean@redhat.com> - 1.15.1-1
0597377
- Removed patch for ipv6 support, now applied upstream.
0597377
- Latest version.
0597377
- New dep on pysocks.
0597377
baa5773
* Fri Feb 26 2016 Ralph Bean <rbean@redhat.com> - 1.13.1-3
baa5773
- Apply patch from upstream to fix ipv6.
baa5773
84fceb2
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.1-2
84fceb2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
84fceb2
948beaa
* Mon Dec 21 2015 Ralph Bean <rbean@redhat.com> - 1.13.1-1
948beaa
- new version
948beaa
298ec5c
* Fri Dec 18 2015 Ralph Bean <rbean@redhat.com> - 1.13-1
298ec5c
- new version
298ec5c
5e3e64d
* Mon Dec 14 2015 Ralph Bean <rbean@redhat.com> - 1.12-1
5e3e64d
- new version
5e3e64d
Robert Kuska 9cbc253
* Thu Oct 15 2015 Robert Kuska <rkuska@redhat.com> - 1.10.4-7
Robert Kuska 9cbc253
- Rebuilt for Python3.5 rebuild
Robert Kuska 9cbc253
a8898e4
* Sat Oct 10 2015 Ralph Bean <rbean@redhat.com> - 1.10.4-6
a8898e4
- Sync from PyPI instead of a git checkout.
a8898e4
762324a
* Tue Sep 08 2015 Ralph Bean <rbean@redhat.com> - 1.10.4-5.20150503gita91975b
762324a
- Drop requirement on python-backports-ssl_match_hostname on F22 and newer.
762324a
d15a22c
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.4-4.20150503gita91975b
d15a22c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
d15a22c
a1d2b32
* Mon Jun 08 2015 Ralph Bean <rbean@redhat.com> - 1.10.4-3.20150503gita91975b
a1d2b32
- Apply pyopenssl injection for an outdated cpython as per upstream advice
a1d2b32
  https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
a1d2b32
  https://urllib3.readthedocs.org/en/latest/security.html#pyopenssl
a1d2b32
7e15819
* Tue May 19 2015 Ralph Bean <rbean@redhat.com> - 1.10.4-2.20150503gita91975b
7e15819
- Specify symlinks for six.py{c,o}, fixing rhbz #1222142.
7e15819
7e15819
* Sun May 03 2015 Ralph Bean <rbean@redhat.com> - 1.10.4-1.20150503gita91975b
65b0367
- Latest release for python-requests-2.7.0
65b0367
98fa605
* Wed Apr 29 2015 Ralph Bean <rbean@redhat.com> - 1.10.3-2.20150429git585983a
98fa605
- Grab a git snapshot to get around this chunked encoding failure.
817aac8
9dff84a
* Wed Apr 22 2015 Ralph Bean <rbean@redhat.com> - 1.10.3-1
9dff84a
- new version
9dff84a
db79cba
* Thu Feb 26 2015 Ralph Bean <rbean@redhat.com> - 1.10.2-1
db79cba
- new version
db79cba
5ce4305
* Wed Feb 18 2015 Ralph Bean <rbean@redhat.com> - 1.10.1-1
5ce4305
- new version
5ce4305
39487aa
* Wed Feb 18 2015 Ralph Bean <rbean@redhat.com> - 1.10.1-1
39487aa
- new version
39487aa
a641ca8
* Mon Jan 05 2015 Ralph Bean <rbean@redhat.com> - 1.10-2
a641ca8
- Copy in a shim for ssl_match_hostname on python3.
a641ca8
f611c7a
* Sun Dec 14 2014 Ralph Bean <rbean@redhat.com> - 1.10-1
f611c7a
- Latest upstream 1.10, for python-requests-2.5.0.
f611c7a
- Re-do unbundling without patch, with symlinks.
f611c7a
- Modernize python2 macros.
2d10204
- Remove the with_dummyserver tests which fail only sometimes.
f611c7a
1960586
* Wed Nov 05 2014 Ralph Bean <rbean@redhat.com> - 1.9.1-1
1960586
- Latest upstream, 1.9.1 for latest python-requests.
1960586
149e0ed
* Mon Aug  4 2014 Tom Callaway <spot@fedoraproject.org> - 1.8.2-4
149e0ed
- fix license handling
149e0ed
90da227
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.2-3
90da227
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
90da227
b8e7d56
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.8.2-2
b8e7d56
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
b8e7d56
131a805
* Mon Apr 21 2014 Arun S A G <sagarun@gmail.com> - 1.8.2-1
131a805
- Update to latest upstream version
131a805
4670672
* Mon Oct 28 2013 Ralph Bean <rbean@redhat.com> - 1.7.1-2
4670672
- Update patch to find ca_certs in the correct location.
4670672
4a646b9
* Wed Sep 25 2013 Ralph Bean <rbean@redhat.com> - 1.7.1-1
4a646b9
- Latest upstream with support for a new timeout class and py3.4.
4a646b9
89b1807
* Wed Aug 28 2013 Ralph Bean <rbean@redhat.com> - 1.7-3
89b1807
- Bump release again, just to push an unpaired update.
89b1807
e709c88
* Mon Aug 26 2013 Ralph Bean <rbean@redhat.com> - 1.7-2
e709c88
- Bump release to pair an update with python-requests.
e709c88
1563f31
* Thu Aug 22 2013 Ralph Bean <rbean@redhat.com> - 1.7-1
1563f31
- Update to latest upstream.
1563f31
- Removed the accept-header proxy patch which is included in upstream now.
1563f31
- Removed py2.6 compat patch which is included in upstream now.
1563f31
da55d72
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-7
da55d72
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
da55d72
f54a32e
* Tue Jun 11 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.5-6
f54a32e
- Fix Requires of python-ordereddict to only apply to RHEL
f54a32e
750fa89
* Fri Mar  1 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.5-5
750fa89
- Unbundling finished!
750fa89
23a06f9
* Fri Mar 01 2013 Ralph Bean <rbean@redhat.com> - 1.5-4
23a06f9
- Upstream patch to fix Accept header when behind a proxy.
23a06f9
- Reorganize patch numbers to more clearly distinguish them.
23a06f9
e2c2602
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 1.5-3
e2c2602
- Renamed patches to python-urllib3-*
e2c2602
- Fixed ssl check patch to use the correct cert path for Fedora.
e2c2602
- Included dependency on ca-certificates
e2c2602
- Cosmetic indentation changes to the .spec file.
e2c2602
e2c2602
* Tue Feb  5 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.5-2
e2c2602
- python3-tornado BR and run all unittests on python3
e2c2602
e2c2602
* Mon Feb 04 2013 Toshio Kuratomi <toshio@fedoraproject.org> 1.5-1
e2c2602
- Initial fedora build.