3 %bcond_with tests # do not perform "make test"
4 %bcond_without python3 # CPython 3.x module
7 Summary: A tool for installing and managing Python packages
12 Group: Development/Libraries
13 URL: http://www.pip-installer.org
14 Source0: http://pypi.python.org/packages/source/p/pip/%{module}-%{version}.tar.gz
15 # Source0-md5: cbb27a191cebc58997c4da8513863153
16 # Sent to dstufft (upstream)
17 Patch0: 0001-fix-for-http-bugs.python.org-issue17980-in-code-back.patch
18 BuildRequires: python-devel
19 BuildRequires: python-modules
20 BuildRequires: python-setuptools
21 BuildRequires: rpm-pythonprov
23 BuildRequires: python3-devel
24 BuildRequires: python3-modules
25 BuildRequires: python3-setuptools
27 Requires: python-setuptools
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Pip is a replacement for easy_install. It uses mostly the same
33 techniques for finding packages, so packages that were made
34 easy_installable should be pip-installable as well.
36 %package -n python3-pip
37 Summary: A tool for installing and managing Python3 packages
38 Group: Development/Libraries
39 Requires: python3-setuptools
41 %description -n python3-pip
42 Pip is a replacement for easy_install. It uses mostly the same
43 techniques for finding packages, so packages that were made
44 easy_installable should be pip-installable as well.
47 %setup -q -n %{module}-%{version}
50 %{__sed} -i '1d' pip/__init__.py
59 %{__python} setup.py build
63 %{__python3} setup.py build
67 rm -rf $RPM_BUILD_ROOT
71 %{__python3} setup.py install \
74 --root $RPM_BUILD_ROOT
76 # Change the name of the python3 pip executable in order to not conflict with
77 # the python2 executable
78 mv $RPM_BUILD_ROOT%{_bindir}/pip $RPM_BUILD_ROOT%{__python}3-pip
80 # after changing the pip-python binary name, make a symlink to the old name,
81 # that will be removed in a later version
82 # https://bugzilla.redhat.com/show_bug.cgi?id=855495
83 ln -s python3-pip $RPM_BUILD_ROOT%{_bindir}/pip-python3
85 # The install process creates both pip and pip-<python_abiversion> that seem to
86 # be the same. Remove the extra script
87 %{__rm} $RPM_BUILD_ROOT%{_bindir}/pip-3*
91 %{__python} setup.py install \
94 --root $RPM_BUILD_ROOT
98 # The install process creates both pip and pip-<python_abiversion> that seem to
99 # be the same. Since removing pip-* also clobbers pip-python3, just remove pip-2*
100 %{__rm} $RPM_BUILD_ROOT%{_bindir}/pip-2*
102 # The pip executable no longer needs to be renamed to avoid conflict with perl-pip
103 # https://bugzilla.redhat.com/show_bug.cgi?id=958377
104 # However, we'll keep a python-pip alias for now
105 ln -s pip $RPM_BUILD_ROOT%{__python}-pip
107 # after changing the pip-python binary name, make a symlink to the old name,
108 # that will be removed in a later version
109 # https://bugzilla.redhat.com/show_bug.cgi?id=855495
110 ln -s pip $RPM_BUILD_ROOT%{_bindir}/pip-python
113 rm -rf $RPM_BUILD_ROOT
116 %defattr(644,root,root,755)
118 %attr(755,root,root) %{_bindir}/pip
119 %attr(755,root,root) %{_bindir}/pip-python
120 %attr(755,root,root) %{_bindir}/python-pip
121 %{py_sitescriptdir}/pip-%{version}-py*.egg-info
122 %{py_sitescriptdir}/pip
125 %files -n python3-pip
126 %defattr(644,root,root,755)
128 %attr(755,root,root) %{_bindir}/pip-python3
129 %attr(755,root,root) %{_bindir}/python3-pip
130 %{py3_sitescriptdir}/pip
131 %{py3_sitescriptdir}/pip-%{version}-py*.egg-info