0c63f5
# sitelib for noarch packages
0c63f5
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
0c63f5
0c63f5
Name:           python-virtualenv
5dfcf4
Version:        15.1.0
978cfa
Release:        4%{?dist}
0c63f5
Summary:        Tool to create isolated Python environments
0c63f5
0c63f5
Group:          Development/Languages
0c63f5
License:        MIT
5dfcf4
URL:            https://pypi.python.org/pypi/virtualenv
5dfcf4
Source0:        https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz
5dfcf4
5dfcf4
# Disable downloading pip, wheel and setuptools from pypi
5dfcf4
# automatically when creating a new venv.
5dfcf4
# Upstream commit that was reverted:
5dfcf4
# https://github.com/pypa/virtualenv/commit/3d7361ff2e31472cb69d00150fbdf5a3c9af2a0d
5dfcf4
Patch0: disable-pypi-downloads-on-venv-creation.patch
5dfcf4
978cfa
# Patch for CVE in the bundled urllib3
978cfa
# CVE-2018-20060 Cross-host redirect does not remove Authorization header allow for credential exposure
978cfa
# https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-20060
978cfa
Patch1:         CVE-2018-20060.patch
978cfa
978cfa
# Patch for CVE in the bundled urllib3
978cfa
# CVE-2019-11236 CRLF injection due to not encoding the '\r\n' sequence leading to possible attack on internal service
978cfa
# https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-11236
978cfa
Patch2:         CVE-2019-11236.patch
978cfa
978cfa
# Patch for CVE in the bundled requests
978cfa
# CVE-2018-18074 Redirect from HTTPS to HTTP does not remove Authorization header
978cfa
# This patch fixes both the CVE
978cfa
# https://bugzilla.redhat.com/show_bug.cgi?id=1643829
978cfa
# and the subsequent regression
978cfa
# https://github.com/psf/requests/pull/4851
978cfa
Patch3:         CVE-2018-18074.patch
978cfa
0c63f5
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
0c63f5
0c63f5
BuildArch:      noarch
0c63f5
BuildRequires:  python2-devel
0c63f5
Requires:       python-setuptools, python2-devel
0c63f5
5dfcf4
Provides:       python2-virtualenv = %{version}-%{release}
5dfcf4
0c63f5
%if 0%{?fedora}
0c63f5
BuildRequires:  python-sphinx
0c63f5
%endif
0c63f5
0c63f5
0c63f5
%description
0c63f5
virtualenv is a tool to create isolated Python environments. virtualenv
0c63f5
is a successor to workingenv, and an extension of virtual-python. It is
0c63f5
written by Ian Bicking, and sponsored by the Open Planning Project. It is
0c63f5
licensed under an MIT-style permissive license.
0c63f5
0c63f5
0c63f5
%prep
0c63f5
%setup -q -n virtualenv-%{version}
2bd489
%patch0 -p1
0c63f5
%{__sed} -i -e "1s|#!/usr/bin/env python||" virtualenv.py 
0c63f5
978cfa
# Patching of bundled libraries
978cfa
pushd virtualenv_support/
978cfa
# Extract wheel content
978cfa
unzip pip-9.0.*-any.whl
978cfa
pushd pip/_vendor/requests/packages/urllib3/
978cfa
%patch1 -p1
978cfa
%patch2 -p1
978cfa
popd  # out of wheel
978cfa
pushd pip/_vendor/requests/
978cfa
%patch3 -p1
978cfa
popd # out of wheel
978cfa
# Replace the pip folder in the zip archive (.whl)
978cfa
zip -r pip-9.0.*-any.whl pip
978cfa
# Remove unzipped folders
978cfa
rm -rf pip/ pip-9.0.*.dist-info/
978cfa
popd  # out of virtualenv_support
0c63f5
0c63f5
%build
0c63f5
# Build code
0c63f5
%{__python} setup.py build
0c63f5
0c63f5
# Build docs on Fedora
0c63f5
%if 0%{?fedora} > 0
0c63f5
%{__python} setup.py build_sphinx
0c63f5
%endif
0c63f5
0c63f5
0c63f5
%install
0c63f5
rm -rf $RPM_BUILD_ROOT
0c63f5
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
0c63f5
rm -f build/sphinx/html/.buildinfo
0c63f5
5dfcf4
# The versioned 2.x script was removed from upstream. Add it back.
5dfcf4
cp %{buildroot}/%{_bindir}/virtualenv %{buildroot}/%{_bindir}/virtualenv-%{python2_version}
5dfcf4
cp %{buildroot}/%{_bindir}/virtualenv %{buildroot}/%{_bindir}/virtualenv-2
5dfcf4
0c63f5
0c63f5
%clean
0c63f5
rm -rf $RPM_BUILD_ROOT
0c63f5
0c63f5
0c63f5
%files
0c63f5
%defattr(-,root,root,-)
0c63f5
%doc docs/*rst PKG-INFO AUTHORS.txt LICENSE.txt
0c63f5
# Include sphinx docs on Fedora
0c63f5
%if 0%{?fedora} > 0
0c63f5
%doc build/sphinx/*
0c63f5
%endif
0c63f5
# For noarch packages: sitelib
0c63f5
%{python_sitelib}/*
0c63f5
%attr(755,root,root) %{_bindir}/virtualenv*
0c63f5
0c63f5
0c63f5
%changelog
978cfa
* Thu Feb 13 2020 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-4
978cfa
- Bump
978cfa
Resolves: rhbz#1649153
978cfa
Resolves: rhbz#1700824
978cfa
Resolves: rhbz#1643829
978cfa
978cfa
* Tue Jan 14 2020 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-3
978cfa
- Add three new patches for CVEs in bundled urllib3 and requests
978cfa
CVE-2018-20060, CVE-2019-11236, CVE-2018-18074
978cfa
Resolves: rhbz#1649153
978cfa
Resolves: rhbz#1700824
978cfa
Resolves: rhbz#1643829
978cfa
5dfcf4
* Wed Sep 13 2017 Charalampos Stratakis <cstratak@redhat.com> - 15.1.0-2
5dfcf4
- Add back the versioned virtualenv script
5dfcf4
Resolves: rhbz#1461154
5dfcf4
5dfcf4
* Wed Sep 13 2017 Charalampos Stratakis <cstratak@redhat.com> - 15.1.0-1
5dfcf4
- Rebase to version 15.1.0
5dfcf4
- Disable automatic downloads from pypi on new venv creation
5dfcf4
Resolves: rhbz#1461154
5dfcf4
6842ff
* Wed Feb 08 2017 Charalampos Stratakis <cstratak@redhat.com> - 1.10.1-4
6842ff
- Fix Python 3.4 compatibility
6842ff
Resolves: rhbz#1411685
6842ff
2bd489
* Mon May 09 2016 Tomas Orsava <torsava@redhat.com> - 1.10.1-3
2bd489
- Added a patch that shows a custom error message when a FILE passed to
2bd489
  virtualenv to be used as 'home dir' already exists and is NOT a directory.
2bd489
Resolves: rhbz#1306513
2bd489
2e4f5e
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.10.1-2
2e4f5e
- Mass rebuild 2013-12-27
2e4f5e
0c63f5
* Tue Aug 20 2013 Robert Kuska <rkuska@redhat.com> - 1.10.1-1
0c63f5
- Update to v1.10.1 to deal with different securiy issue
0c63f5
Resolves: CVE-2013-1633 
0c63f5
0c63f5
* Wed Jul 17 2013 Robert Kuska <rkuska@redhat.com> - 1.9.1-2
0c63f5
- Delete bundled libraries of pip and setuptools
0c63f5
0c63f5
* Tue May 14 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.9.1-1
0c63f5
- Update to upstream 1.9.1 because of security issues with the bundled
0c63f5
  python-pip in older releases.  This is just a quick fix until a
0c63f5
  python-virtualenv maintainer can unbundle the python-pip package
0c63f5
  see: https://bugzilla.redhat.com/show_bug.cgi?id=749378
0c63f5
0c63f5
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.2-2
0c63f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
0c63f5
0c63f5
* Tue Aug 14 2012 Steve Milner <me@stevemilner.org> - 1.7.2-1
0c63f5
- Update for upstream bug fixes.
0c63f5
- Added path for versioned binary.
0c63f5
- Patch no longer required.
0c63f5
0c63f5
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.1.2-3
0c63f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
0c63f5
0c63f5
* Wed Mar 14 2012 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.7.1.2-1
0c63f5
- Update for upstream bug fixes.
0c63f5
- Added patch for sphinx building
0c63f5
0c63f5
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-2
0c63f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
0c63f5
0c63f5
* Tue Dec 20 2011 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.7-1
0c63f5
- Update for https://bugzilla.redhat.com/show_bug.cgi?id=769067
0c63f5
0c63f5
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-2
0c63f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
0c63f5
0c63f5
* Sat Oct 16 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.5.1-1
0c63f5
- Added _weakrefset requirement for Python 2.7.1.
0c63f5
- Add support for PyPy.
0c63f5
- Uses a proper temporary dir when installing environment requirements.
0c63f5
- Add --prompt option to be able to override the default prompt prefix.
0c63f5
- Add fish and csh activate scripts.
0c63f5
0c63f5
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.4.8-4
0c63f5
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
0c63f5
0c63f5
* Tue Jul  7 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.4.8-3
0c63f5
- Fixed EPEL installation issue from BZ#611536
0c63f5
0c63f5
* Tue Jun  8 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.4.8-2
0c63f5
- Only replace the python shebang on the first line (Robert Buchholz)
0c63f5
0c63f5
* Fri Apr 28 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.4.8-1
0c63f5
- update pip to 0.7
0c63f5
- move regen-docs into bin/
0c63f5
- Fix #31, make activate_this.py work on Windows (use Lib/site-packages)
0c63f5
unset PYTHONHOME envioronment variable -- first step towards fixing the PYTHONHOME issue; see e.g. https://bugs.launchpad.net/virtualenv/+bug/290844
0c63f5
- unset PYTHONHOME in the (Unix) activate script (and reset it in deactivate())
0c63f5
- use the activate.sh in virtualenv.py via running bin/rebuild-script.py
0c63f5
- add warning message if PYTHONHOME is set
0c63f5
0c63f5
* Fri Apr 2 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.4.6-1
0c63f5
- allow script creation without setuptools
0c63f5
- fix problem with --relocate when bin/ has subdirs (fixes #12)
0c63f5
- Allow more flexible .pth file fixup
0c63f5
- make nt a required module, along with posix. it may not be a builtin module on jython
0c63f5
- don't mess with PEP 302-supplied __file__, from CPython, and merge in a small startup optimization for Jython, from Jython
0c63f5
0c63f5
* Tue Dec 22 2009 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.4.3-1
0c63f5
- Updated for upstream release.
0c63f5
0c63f5
* Thu Nov 12 2009 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.4.2-1
0c63f5
- Updated for upstream release.
0c63f5
0c63f5
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.3-2
0c63f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
0c63f5
0c63f5
* Tue Apr 28 2009 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.3-1
0c63f5
- Updated for upstream release.
0c63f5
0c63f5
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-2
0c63f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
0c63f5
0c63f5
* Thu Dec 25 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.2-1
0c63f5
- Updated for upstream release.
0c63f5
0c63f5
* Thu Dec 04 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.3.1-4
0c63f5
- Rebuild for Python 2.6
0c63f5
0c63f5
* Mon Dec  1 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-3
0c63f5
- Added missing dependencies.
0c63f5
0c63f5
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.3.1-2
0c63f5
- Rebuild for Python 2.6
0c63f5
0c63f5
* Fri Nov 28 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-1
0c63f5
- Updated for upstream release
0c63f5
0c63f5
* Sun Sep 28 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3-1
0c63f5
- Updated for upstream release
0c63f5
0c63f5
* Sat Aug 30 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.2-1
0c63f5
- Updated for upstream release
0c63f5
0c63f5
* Fri Aug 29 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.1-3
0c63f5
- Updated from review notes
0c63f5
0c63f5
* Thu Aug 28 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.1-2
0c63f5
- Updated from review notes
0c63f5
0c63f5
* Tue Aug 26 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.1-1
0c63f5
- Initial Version