e2c2602
%global srcname urllib3
e2c2602
d2ba833
# When bootstrapping Python, we cannot test this yet
d2ba833
%bcond_without tests
d2ba833
e2c2602
Name:           python-%{srcname}
Jeremy Cline d68ec5c
Version:        1.24.2
Jeremy Cline d68ec5c
Release:        1%{?dist}
e2c2602
Summary:        Python HTTP library with thread-safe connection pooling and file post
e2c2602
e2c2602
License:        MIT
Jeremy Cline 9c6ea19
URL:            https://github.com/urllib3/urllib3
821ff06
Source0:        %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
Jeremy Cline 9c6ea19
# Unbundle ssl_match_hostname since we depend on it
Jeremy Cline 4425178
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:
31b337f
Requires:       python2-six
31b337f
Requires:       python2-backports-ssl_match_hostname
821ff06
821ff06
# Secure extra requirements
31b337f
Requires:       python2-ipaddress
31b337f
Requires:       python2-pysocks
0597377
e2c2602
BuildRequires:  python2-devel
d2ba833
%if %{with tests}
Jeremy Cline 9c6ea19
BuildRequires:  python2-backports-ssl_match_hostname
31b337f
BuildRequires:  python2-nose
31b337f
BuildRequires:  python2-nose-exclude
31b337f
BuildRequires:  python2-coverage
31b337f
BuildRequires:  python2-mock
31b337f
BuildRequires:  python2-six
31b337f
BuildRequires:  python2-pysocks
bda1937
BuildRequires:  python2-pytest
31b337f
BuildRequires:  python2-tornado
d2ba833
%endif
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
d2ba833
%if %{with tests}
821ff06
BuildRequires:  python3-nose
821ff06
BuildRequires:  python3-mock
821ff06
BuildRequires:  python3-six
821ff06
BuildRequires:  python3-pysocks
bda1937
BuildRequires:  python3-pytest
821ff06
BuildRequires:  python3-tornado
d2ba833
%endif
0597377
0597377
Requires:       ca-certificates
821ff06
Requires:       python3-six
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
Jeremy Cline 9c6ea19
%autosetup -p1 -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/
da96fff
# Don't run the Google App Engine tests
da96fff
rm -rf test/appengine/
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
Jeremy Cline 9c6ea19
# Tests for Python built without SSL, but Fedora builds with SSL. These tests
Jeremy Cline 9c6ea19
# fail when combined with the unbundling of backports-ssl_match_hostname
Jeremy Cline 9c6ea19
rm -f test/test_no_ssl.py
Jeremy Cline 9c6ea19
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*
Jeremy Cline 4425178
rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname/
f611c7a
f611c7a
mkdir -p %{buildroot}/%{python2_sitelib}/urllib3/packages/
Jeremy Cline 9c6ea19
ln -s %{python2_sitelib}/six.py %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py
Jeremy Cline 9c6ea19
ln -s %{python2_sitelib}/six.pyc %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyc
Jeremy Cline 9c6ea19
ln -s %{python2_sitelib}/six.pyo %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyo
Jeremy Cline 4425178
ln -s %{python2_sitelib}/backports/ssl_match_hostname \
Jeremy Cline 4425178
      %{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*
a4ea2a3
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six*
Jeremy Cline 4425178
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/
f611c7a
f611c7a
mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/
Jeremy Cline 4425178
cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
Jeremy Cline 9c6ea19
ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
Jeremy Cline 9c6ea19
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc \
Jeremy Cline 9c6ea19
      %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
Jeremy Cline 9c6ea19
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc \
Jeremy Cline 9c6ea19
      %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
f611c7a
e2c2602
d2ba833
%if %{with tests}
e2c2602
%check
Jeremy Cline 9c6ea19
pushd test
Jeremy Cline 9c6ea19
PYTHONPATH=%{buildroot}%{python2_sitelib}:%{python2_sitelib} %{__python2} -m pytest -v
Jeremy Cline 9c6ea19
PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} %{__python3} -m pytest -v
Jeremy Cline 9c6ea19
popd
d2ba833
%endif
e2c2602
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
4a6b9a8
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.24.1-3
4a6b9a8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
4a6b9a8
Jeremy Cline 4425178
* Tue Nov 13 2018 Jeremy Cline <jeremy@jcline.org> - 1.24.1-2
Jeremy Cline 4425178
- Adjust unbundling of ssl_match_hostname
Jeremy Cline 4425178
Jeremy Cline 9c6ea19
* Mon Oct 29 2018 Jeremy Cline <jeremy@jcline.org> - 1.24.1-1
Jeremy Cline 9c6ea19
- Update to v1.24.1
Jeremy Cline 9c6ea19
da5d9b9
* Wed Jun 20 2018 Lumír Balhar <lbalhar@redhat.com> - 1.23-4
da5d9b9
- Removed unneeded dependency python[23]-psutil
da5d9b9
5a18048
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.23-3
5a18048
- Rebuilt for Python 3.7
5a18048
ab1886d
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 1.23-2
ab1886d
- Bootstrap for Python 3.7
ab1886d
Jeremy Cline 0b513a8
* Tue Jun 05 2018 Jeremy Cline <jeremy@jcline.org> - 1.23-1
Jeremy Cline 0b513a8
- Update to the latest upstream release (rhbz 1586072)
Jeremy Cline 0b513a8
Jeremy Cline 0905637
* Wed May 30 2018 Jeremy Cline <jeremy@jcline.org> - 1.22-10
Jeremy Cline 0905637
- Backport patch to support Python 3.7 (rhbz 1584112)
Jeremy Cline 0905637
f9db920
* Thu May 03 2018 Lukas Slebodnik <lslebodn@fedoraproject.org> - 1.22-9
f9db920
- Do not lowercase hostnames with custom-protocol (rhbz 1567862)
f9db920
- upstream: https://github.com/urllib3/urllib3/issues/1267
f9db920
f545e58
* Wed Apr 18 2018 Jeremy Cline <jeremy@jcline.org> - 1.22-8
f545e58
- Drop the dependency on idna and cryptography (rhbz 1567862)
f545e58
2b8e0c7
* Mon Apr 16 2018 Jeremy Cline <jeremy@jcline.org> - 1.22-7
2b8e0c7
- Drop the dependency on PyOpenSSL, it's not needed (rhbz 1567862)
2b8e0c7
ff1ca88
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.22-6
ff1ca88
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ff1ca88
31b337f
* Wed Jan 31 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.22-5
31b337f
- Update Python 2 dependency declarations to new packaging standards
31b337f
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
31b337f
9b84183
* Thu Jan 25 2018 Tomas Hoger <thoger@redhat.com> - 1.22-4
9b84183
- Fix FTBFS - Move RECENT_DATE to 2017-06-30
9b84183
a4ea2a3
* Fri Dec 01 2017 Jeremy Cline <jeremy@jcline.org> - 1.22-3
a4ea2a3
- Symlink the Python 3 bytecode for six (rbhz 1519147)
a4ea2a3
cd30118
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.22-2
cd30118
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cd30118
d5c3e09
* Fri Jul 21 2017 Jeremy Cline <jeremy@jcline.org> - 1.22-1
d5c3e09
- Update to 1.22 (#1473293)
d5c3e09
ebed522
* Wed May 17 2017 Jeremy Cline <jeremy@jcline.org> - 1.21.1-1
ebed522
- Update to 1.21.1 (#1445280)
ebed522
6a3f489
* Thu Feb 09 2017 Jeremy Cline <jeremy@jcline.org> - 1.20-1
6a3f489
- Update to 1.20 (#1414775)
6a3f489
f7d96a6
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 1.19.1-2
f7d96a6
- Rebuild for Python 3.6
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.