diff --git a/pip-8.1.2-shipped-requests-cabundle.patch b/pip-8.1.2-shipped-requests-cabundle.patch new file mode 100644 index 0000000..31de86d --- /dev/null +++ b/pip-8.1.2-shipped-requests-cabundle.patch @@ -0,0 +1,13 @@ +diff -ruN a/pip/_vendor/requests/certs.py b/pip/_vendor/requests/certs.py +--- a/pip/_vendor/requests/certs.py 2014-05-16 20:03:31.000000000 +0200 ++++ b/pip/_vendor/requests/certs.py 2014-07-03 09:54:46.751966582 +0200 +@@ -19,8 +19,7 @@ + except ImportError: + def where(): + """Return the preferred certificate bundle.""" +- # vendored bundle inside Requests +- return os.path.join(os.path.dirname(__file__), 'cacert.pem') ++ return "/etc/ssl/ca-bundle.pem" + + if __name__ == '__main__': + print(where()) diff --git a/python-pip.changes b/python-pip.changes index 8413265..25f44cc 100644 --- a/python-pip.changes +++ b/python-pip.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Feb 23 15:31:57 UTC 2017 - jmatejek@suse.com + +- update for singlespec +- fix alternative priorities +- drop cacert.pem and add pip-8.1.2-shipped-requests-cabundle.patch + to ensure function without it +- add ca-certificates{,-mozilla} dependency to ensure existence of CA bundle +- add fdupes + ------------------------------------------------------------------- Sun Jan 8 14:53:21 UTC 2017 - michael@stroeder.com diff --git a/python-pip.spec b/python-pip.spec index bb0182d..5c4a09e 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -1,7 +1,7 @@ # # spec file for package python-pip # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,6 +20,7 @@ # enable testing with a build conditional (off by default): %bcond_with test +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pip Version: 9.0.1 Release: 0 @@ -28,49 +29,55 @@ Summary: Pip installs packages. Python packages. An easy_install replacem License: MIT Group: Development/Languages/Python Source: https://pypi.io/packages/source/p/pip/pip-%{version}.tar.gz +Patch0: pip-8.1.2-shipped-requests-cabundle.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-devel -BuildRequires: python-setuptools +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros %if %{with test} # Test requirements: -BuildRequires: python-mock -BuildRequires: python-pytest -BuildRequires: python-scripttest >= 1.3 -BuildRequires: python-virtualenv >= 1.10 +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module scripttest >= 1.3} +BuildRequires: %{python_module virtualenv >= 1.10} %endif +Requires: ca-certificates Requires: coreutils Requires: python-setuptools Requires: python-xml +Recommends: ca-certificates-mozilla Requires(post): update-alternatives Requires(postun): update-alternatives -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -BuildRequires: python-argparse -Requires: python-argparse -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else BuildArch: noarch -%endif + +%python_subpackages %description Pip is a replacement for easy_install. It uses mostly the same techniques for finding packages, so packages that were made easy_installable should be pip-installable as well. + %prep %setup -q -n pip-%{version} -sed -i "s|#!/usr/bin/env python||g" pip/__init__.py # Fix non-executable script +%patch0 -p1 +find pip/_vendor -name *.py -exec \ + sed -i "s|#!/usr/bin/env python||g" {} ";" # Fix non-executable script +#sed -i "s|#!/usr/bin/env python||g" pip/__init__.py # Fix non-executable script +rm pip/_vendor/requests/cacert.pem %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} -rm %{buildroot}%{_bindir}/pip -ln -s %{_bindir}/pip%{py_ver} %{buildroot}%{_bindir}/pip +%python_install +%prepare_alternative pip +%fdupes %{buildroot}%{_prefix} %if %{with test} %check -python setup.py test +%python_exec setup.py test %endif %pre @@ -79,23 +86,34 @@ python setup.py test [ -h %{_bindir}/pip ] || rm -f %{_bindir}/pip %post -update-alternatives --install %{_bindir}/pip pip %{_bindir}/pip%{py_ver} 20 - -%preun -if [ $1 -eq 0 ] ; then - update-alternatives --remove pip %{_bindir}/pip%{py_ver} -fi - -%files -%defattr(-,root,root,-) -%doc AUTHORS.txt CHANGES.txt LICENSE.txt README.rst -%ghost %{_bindir}/pip -%{_bindir}/pip2 -%{_bindir}/pip%{py_ver} -%{python_sitelib}/pip-%{version}-py%{py_ver}.egg-info -%{python_sitelib}/pip -%if 0%{?suse_version} >= 1230 -%ghost %{_sysconfdir}/alternatives/pip +# can't use `python_install_alternative` because it's pipX.Y, not pip-X.Y +PRIO=$(echo %{python_version} | tr -d .) +%ifpypy3 +%install_alternative pip %{_bindir}/pip-%{pypy3_bin_suffix} $PRIO +%else +%install_alternative pip %{_bindir}/pip%{python_version} $PRIO %endif +%preun +%ifpypy3 +%uninstall_alternative pip %{_bindir}/pip-%{pypy3_bin_suffix} +%else +%uninstall_alternative pip %{_bindir}/pip%{python_version} +%endif + +%files %{python_files} +%defattr(-,root,root,-) +%doc AUTHORS.txt CHANGES.txt LICENSE.txt README.rst +%{_bindir}/pip +%python2_only %{_bindir}/pip2 +%python3_only %{_bindir}/pip3 +%ifpypy3 +%{_bindir}/pip-%{pypy3_bin_suffix} +%else +%{_bindir}/pip%{python_version} +%endif +%ghost %{_sysconfdir}/alternatives/pip +%{python_sitelib}/pip-%{version}-py%{python_version}.egg-info +%{python_sitelib}/pip + %changelog