%define pypi_name pip %define build_wheel 1 %if 0%{?build_wheel} %define python2_wheelname %{pypi_name}-%{version}-py2.py3-none-any.whl %define python3_wheelname %python2_wheelname %endif Name: python-pip Version: 1.5.6 Release: %mkrel 3 Group: Development/Python Summary: pip installs packages. Python packages. An easy_install replacement License: MIT URL: http://pypi.python.org/pypi/pip Source0: http://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz Patch0: pip-1.5.6-allow-stripping-prefix-from-wheel-RECORD-files.patch BuildArch: noarch BuildRequires: pkgconfig(python) BuildRequires: python-setuptools %if 0%{?build_wheel} BuildRequires: python-pip BuildRequires: python-wheel %endif Requires: python-setuptools Requires: python-pkg-resources %description `pip` is a tool for installing and managing Python packages, such as those found in the `Python Package Index`_. It's a replacement for easy_install_. %package -n python3-pip Summary: A tool for installing and managing Python3 packages Group: Development/Python BuildRequires: pkgconfig(python3) BuildRequires: python3-setuptools %if 0%{?build_wheel} BuildRequires: python3-pip BuildRequires: python3-wheel %endif Requires: python3-setuptools %description -n python3-pip 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 %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %apply_patches %{__sed} -i '1d' pip/__init__.py cp -a . %{py3dir} %build %if 0%{?build_wheel} %{__python} setup.py bdist_wheel %else %{__python} setup.py build %endif pushd %{py3dir} %if 0%{?build_wheel} %{__python3} setup.py bdist_wheel %else %{__python3} setup.py build %endif popd %install pushd %{py3dir} %if 0%{?build_wheel} pip3 install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot} # TODO: we have to remove this by hand now, but it'd be nice if we wouldn't have to # (pip install wheel doesn't overwrite) rm %{buildroot}%{_bindir}/pip %else %{__python3} setup.py install --skip-build --root %{buildroot} %endif popd %if 0%{?build_wheel} pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot} %else %{__python} setup.py install -O1 --skip-build --root %{buildroot} %endif %files %doc LICENSE.txt PKG-INFO docs %attr(755,root,root) %{_bindir}/pip %attr(755,root,root) %{_bindir}/pip2* %{python_sitelib}/pip* %files -n python3-pip %doc LICENSE.txt PKG-INFO docs %attr(755,root,root) %{_bindir}/pip3* %{python3_sitelib}/pip*