Blame SPECS/python-pip.spec

7a22a9
%{?scl:%scl_package python-setuptools}
7a22a9
%{!?scl:%global pkg_name %{name}}
7a22a9
7a22a9
%global build_wheel 0
7a22a9
%if 0%{?rhel} && 0%{?rhel} < 6
7a22a9
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
7a22a9
%endif
7a22a9
7a22a9
%global srcname pip
7a22a9
%if 0%{?build_wheel}
265074
%global python2_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
265074
%endif
265074
265074
%global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d})
265074
%if "%{bashcompdir}" != "%{_sysconfdir}/bash_completion.d"
265074
%global bashcomp2 1
7a22a9
%endif
7a22a9
7a22a9
Name:           %{?scl_prefix}python-%{srcname}
684680
Version:        8.1.2
fd99fe
Release:        7%{?dist}
7a22a9
Summary:        A tool for installing and managing Python packages
7a22a9
7a22a9
Group:          Development/Libraries
da3530
da3530
# We bundle a lot of libraries with pip, which itself is under MIT license.
da3530
# Here is the list of the libraries with corresponding licenses:
da3530
da3530
# distlib: Python
da3530
# html5lib: MIT
da3530
# six: MIT
da3530
# colorama: BSD
da3530
# CacheControl: ASL 2.0
da3530
# lockfile: MIT
da3530
# progress: ISC
da3530
# ipaddress: Python
da3530
# packaging: ASL 2.0 or BSD
da3530
# pyparsing: MIT
da3530
# retrying: ASL 2.0
da3530
# requests: ASL 2.0
da3530
# chardet: LGPLv2
da3530
# urllib3: MIT
da3530
# setuptools: MIT
da3530
# backports.ssl_match_hostname: Python
da3530
da3530
License:        MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and (ASL 2.0 or BSD)
7a22a9
URL:            http://www.pip-installer.org
684680
Source0:        https://files.pythonhosted.org/packages/source/p/pip/%{srcname}-%{version}.tar.gz
684680
684680
Patch0:         allow-stripping-given-prefix-from-wheel-RECORD-files.patch
684680
684680
# Fix `pip install` failure in FIPS mode
684680
# Resolves: rhbz#1430763
684680
Patch1:         Fix-pip-install-in-FIPS-mode.patch
7a22a9
da3530
da3530
# Use the system level root certificate instead of the one bundled in requests
fd99fe
# https://bugzilla.redhat.com/show_bug.cgi?id=1774985
da3530
Patch4:         dummy-certifi.patch
da3530
da3530
# Fix CVE-2019-20916: directory traversal in _download_http_url() function
da3530
# Backported from upstream: https://github.com/pypa/pip/pull/6418
da3530
Patch5:         CVE-2019-20916.patch
da3530
7a22a9
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
7a22a9
7a22a9
BuildArch:      noarch
7a22a9
BuildRequires:  %{?scl_prefix}python-devel
7a22a9
BuildRequires:  %{?scl_prefix}python-setuptools
7a22a9
%if 0%{?build_wheel}
7a22a9
BuildRequires:  %{?scl_prefix}python-pip
7a22a9
BuildRequires:  %{?scl_prefix}python-wheel
7a22a9
%endif
da3530
BuildRequires:  ca-certificates
da3530
Requires:       ca-certificates
7a22a9
Requires:       %{?scl_prefix}python-setuptools
7a22a9
da3530
da3530
# Virtual provides for the packages bundled by pip.
da3530
# You can find the versions in pip/_vendor/vendor.txt file.
da3530
Provides: bundled(python-cachecontrol) = 0.11.6
da3530
Provides: bundled(python-colorama) = 0.3.7
da3530
Provides: bundled(python-distlib) = 0.2.3
da3530
Provides: bundled(python-html5lib) = 1.0b8
da3530
Provides: bundled(python-ipaddress) = 1.0.16
da3530
Provides: bundled(python-lockfile) = 0.12.2
da3530
Provides: bundled(python-packaging) = 16.7
da3530
Provides: bundled(python-setuptools) = 21.0.0
da3530
Provides: bundled(python-progress) = 1.2
da3530
Provides: bundled(python-pyparsing) = 2.1.1
da3530
Provides: bundled(python-requests) = 2.10.0
da3530
Provides: bundled(python-retrying) = 1.3.3
da3530
Provides: bundled(python-six) = 1.10.0
da3530
da3530
# Bundled within the requests bundle
da3530
Provides: bundled(python-chardet) = 2.3.0
da3530
Provides: bundled(python-urllib3) = 1.15.1
da3530
da3530
# Bundled within the urllib3 bundle of the requests bundle
da3530
Provides: bundled(python-backports-ssl_match_hostname) = 3.4.0.2
da3530
7a22a9
%description
7a22a9
Pip is a replacement for `easy_install
7a22a9
<http://peak.telecommunity.com/DevCenter/EasyInstall>`_.  It uses mostly the
7a22a9
same techniques for finding packages, so packages that were made
7a22a9
easy_installable should be pip-installable as well.
7a22a9
7a22a9
265074
7a22a9
%prep
7a22a9
%{?scl:scl enable %{scl} - << \EOF}
7a22a9
%setup -q -n %{srcname}-%{version}
7a22a9
7a22a9
%patch0 -p1
684680
%patch1 -p1
da3530
%patch4 -p1
da3530
%patch5 -p1
7a22a9
7a22a9
%{__sed} -i '1d' pip/__init__.py
da3530
da3530
# this goes together with patch4
da3530
rm pip/_vendor/requests/*.pem
da3530
sed -i '/\.pem$/d' pip.egg-info/SOURCES.txt
fd99fe
fd99fe
# Remove windows executable binaries
fd99fe
rm -v pip/_vendor/distlib/*.exe
fd99fe
sed -i '/\.exe/d' setup.py
7a22a9
%{?scl:EOF}
7a22a9
7a22a9
7a22a9
%build
7a22a9
%{?scl:scl enable %{scl} - << \EOF}
7a22a9
%if 0%{?build_wheel}
7a22a9
%{__python2} setup.py bdist_wheel
7a22a9
%else
7a22a9
%{__python2} setup.py build
7a22a9
%endif
7a22a9
%{?scl:EOF}
7a22a9
7a22a9
7a22a9
%install
7a22a9
%{__rm} -rf %{buildroot}
7a22a9
7a22a9
%{?scl:scl enable %{scl} - << \EOF}
7a22a9
%if 0%{?build_wheel}
265074
pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
7a22a9
%else
265074
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
7a22a9
%endif
7a22a9
265074
mkdir -p %{buildroot}%{bashcompdir}
265074
PYTHONPATH=%{buildroot}%{python_sitelib} \
265074
    %{buildroot}%{_bindir}/pip completion --bash \
265074
    > %{buildroot}%{bashcompdir}/pip
265074
pips2=pip
265074
for pip in %{buildroot}%{_bindir}/pip*; do
265074
    pip=$(basename $pip)
265074
    case $pip in
265074
        pip2*)
265074
            pips2="$pips2 $pip"
265074
%if 0%{?bashcomp2}
265074
            ln -s pip %{buildroot}%{bashcompdir}/$pip
265074
%endif
265074
    esac
265074
done
265074
265074
sed -i -e "s/^\\(complete.*\\) pip\$/\\1 $pips2/" \
265074
    %{buildroot}%{bashcompdir}/pip
265074
%{?scl:EOF}
7a22a9
7a22a9
%clean
7a22a9
%{__rm} -rf %{buildroot}
7a22a9
7a22a9
7a22a9
%files
7a22a9
%defattr(-,root,root,-)
265074
%doc README.rst LICENSE.txt docs
265074
%attr(755,root,root) %{_bindir}/pip
265074
%attr(755,root,root) %{_bindir}/pip2*
265074
%{python_sitelib}/pip*
265074
%{bashcompdir}
265074
%if 0%{?bashcomp2}
265074
%dir %(dirname %{bashcompdir})
265074
%endif
265074
7a22a9
7a22a9
%changelog
fd99fe
* Wed Mar 16 2022 Charalampos Stratakis <cstratak@redhat.com> - 8.1.2-7
fd99fe
- Remove bundled windows executables
fd99fe
Resolves: rhbz#2064442
fd99fe
da3530
* Wed Sep 23 2020 Charalampos Stratakis <cstratak@redhat.com> - 8.1.2-6
da3530
- Security fix for CVE-2019-20916
fd99fe
Resolves: rhbz#1877248
da3530
da3530
* Wed Sep 23 2020 Charalampos Stratakis <cstratak@redhat.com> - 8.1.2-5
da3530
- Use the system level root certificate instead of the one bundled in requests
fd99fe
Resolves: rhbz#1774985
da3530
da3530
* Wed Sep 23 2020 Charalampos Stratakis <cstratak@redhat.com> - 8.1.2-4
da3530
- Add virtual provides for the bundled libraries
da3530
- Correct the license information to reflect the bundled libraries
fd99fe
Resolves: rhbz#1774944
da3530
10d00a
* Wed May 23 2018 Charalampos Stratakis <cstratak@redhat.com> - 8.1.2-3
10d00a
- Rebuild for multi-arch bootstrap of python27
10d00a
684680
* Fri Mar 17 2017 Tomas Orsava <torsava@redhat.com> - 8.1.2-2
684680
- Added Patch 1: Fix `pip install` failure in FIPS mode
684680
Resolves: rhbz#1430763
684680
684680
* Mon Jan 16 2017 Tomas Orsava <torsava@redhat.com> - 8.1.2-1
684680
- Rebased to 8.1.2
684680
- Updated to a new PyPI source URL
684680
- Rebased and renamed prefix-stripping Patch 0
684680
Resolves: rhbz#1344674
684680
265074
* Tue May 10 2016 Charalampos Stratakis <cstratak@redhat.com> - 7.1.0-2
265074
- Change license tag to doc tag so directory is owned by the collection
265074
- Will revert when ownership of directories is defined in scl-utils-build package
265074
Resolves: rhbz#1334447
265074
265074
* Mon Feb 15 2016 Charalampos Stratakis <cstratak@redhat.com> - 7.1.0-1
265074
- Update to 7.1.0 
265074
Resolves: rhbz#1255516
265074
7a22a9
* Tue Jan 20 2015 Slavek Kabrda <bkabrda@redhat.com> - 1.5.6-5
7a22a9
- Rebuild for python27 (not as wheel)
7a22a9
Resolves: rhbz#994189
7a22a9
7a22a9
* Mon Jan 19 2015 Matej Stuchlik <mstuchli@redhat.com> - 1.5.6-4
7a22a9
- Rebuild as wheel
7a22a9
7a22a9
* Tue Nov 18 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.5.6-3
7a22a9
- Added patch for local dos with predictable temp dictionary names
7a22a9
  (http://seclists.org/oss-sec/2014/q4/655)
7a22a9
7a22a9
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.6-2
7a22a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
7a22a9
7a22a9
* Sun May 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.5.6-1
7a22a9
- Update to 1.5.6
7a22a9
7a22a9
* Fri Apr 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.5.4-4
7a22a9
- Rebuild as wheel for Python 3.4
7a22a9
7a22a9
* Thu Apr 24 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.5.4-3
7a22a9
- Disable build_wheel
7a22a9
7a22a9
* Thu Apr 24 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.5.4-2
7a22a9
- Rebuild as wheel for Python 3.4
7a22a9
7a22a9
* Mon Apr 07 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.5.4-1
7a22a9
- Updated to 1.5.4
7a22a9
7a22a9
* Mon Oct 14 2013 Tim Flink <tflink@fedoraproject.org> - 1.4.1-1
7a22a9
- Removed patch for CVE 2013-2099 as it has been included in the upstream 1.4.1 release
7a22a9
- Updated version to 1.4.1
7a22a9
7a22a9
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-5
7a22a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
7a22a9
7a22a9
* Tue Jul 16 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3.1-4
7a22a9
- Fix for CVE 2013-2099
7a22a9
7a22a9
* Thu May 23 2013 Tim Flink <tflink@fedoraproject.org> - 1.3.1-3
7a22a9
- undo python2 executable rename to python-pip. fixes #958377
7a22a9
- fix summary to match upstream
7a22a9
7a22a9
* Mon May 06 2013 Kevin Kofler <Kevin@tigcc.ticalc.org> - 1.3.1-2
7a22a9
- Fix main package Summary, it's for Python 2, not 3 (#877401)
7a22a9
7a22a9
* Fri Apr 26 2013 Jon Ciesla <limburgher@gmail.com> - 1.3.1-1
7a22a9
- Update to 1.3.1, fix for CVE-2013-1888.
7a22a9
7a22a9
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-3
7a22a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
7a22a9
7a22a9
* Tue Oct 09 2012 Tim Flink <tflink@fedoraproject.org> - 1.2.1-2
7a22a9
- Fixing files for python3-pip
7a22a9
7a22a9
* Thu Oct 04 2012 Tim Flink <tflink@fedoraproject.org> - 1.2.1-1
7a22a9
- Update to upstream 1.2.1
7a22a9
- Change binary from pip-python to python-pip (RHBZ#855495)
7a22a9
- Add alias from python-pip to pip-python, to be removed at a later date
7a22a9
7a22a9
* Tue May 15 2012 Tim Flink <tflink@fedoraproject.org> - 1.1.0-1
7a22a9
- Update to upstream 1.1.0
7a22a9
7a22a9
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-2
7a22a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
7a22a9
7a22a9
* Sat Oct 22 2011 Tim Flink <tflink@fedoraproject.org> - 1.0.2-1
7a22a9
- update to 1.0.2 and added python3 subpackage
7a22a9
7a22a9
* Wed Jun 22 2011 Tim Flink <tflink@fedoraproject.org> - 0.8.3-1
7a22a9
- update to 0.8.3 and project home page
7a22a9
7a22a9
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-2
7a22a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
7a22a9
7a22a9
* Mon Dec 20 2010 Luke Macken <lmacken@redhat.com> - 0.8.2-1
7a22a9
- update to 0.8.2 of pip
7a22a9
* Mon Aug 30 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.8-1
7a22a9
- update to 0.8 of pip
7a22a9
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.7.2-5
7a22a9
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
7a22a9
7a22a9
* Wed Jul 7 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.7.2-1
7a22a9
- update to 0.7.2 of pip
7a22a9
* Sun May 23 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.7.1-1
7a22a9
- update to 0.7.1 of pip
7a22a9
* Fri Jan 1 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.6.1.4
7a22a9
- fix dependency issue
7a22a9
* Fri Dec 18 2009 Peter Halliday <phalliday@excelsiorsystems.net> - 0.6.1-2
7a22a9
- fix spec file 
7a22a9
* Thu Dec 17 2009 Peter Halliday <phalliday@excelsiorsystems.net> - 0.6.1-1
7a22a9
- upgrade to 0.6.1 of pip
7a22a9
* Mon Aug 31 2009 Peter Halliday <phalliday@excelsiorsystems.net> - 0.4-1
7a22a9
- Initial package