]> git.pld-linux.org Git - packages/python-pip.git/blame - python-pip.spec
- python 3.4
[packages/python-pip.git] / python-pip.spec
CommitLineData
f320d32d
ER
1#
2# Conditional build:
3%bcond_with tests # do not perform "make test"
4%bcond_without python3 # CPython 3.x module
5
6%define module pip
7Summary: A tool for installing and managing Python packages
8Name: python-%{module}
9Version: 1.3.1
1f61faa8 10Release: 2
f320d32d
ER
11License: MIT
12Group: Development/Libraries
13URL: http://www.pip-installer.org
14Source0: http://pypi.python.org/packages/source/p/pip/%{module}-%{version}.tar.gz
15# Source0-md5: cbb27a191cebc58997c4da8513863153
16# Sent to dstufft (upstream)
17Patch0: 0001-fix-for-http-bugs.python.org-issue17980-in-code-back.patch
18BuildRequires: python-devel
57b31609 19BuildRequires: python-modules
f320d32d 20BuildRequires: python-setuptools
57b31609 21BuildRequires: rpm-pythonprov
f320d32d
ER
22%if %{with python3}
23BuildRequires: python3-devel
57b31609 24BuildRequires: python3-modules
f320d32d
ER
25BuildRequires: python3-setuptools
26%endif
27Requires: python-setuptools
28BuildArch: noarch
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
32Pip is a replacement for easy_install. It uses mostly the same
33techniques for finding packages, so packages that were made
34easy_installable should be pip-installable as well.
35
36%package -n python3-pip
37Summary: A tool for installing and managing Python3 packages
38Group: Development/Libraries
39Requires: python3-setuptools
40
41%description -n python3-pip
42Pip is a replacement for easy_install. It uses mostly the same
43techniques for finding packages, so packages that were made
44easy_installable should be pip-installable as well.
45
46%prep
47%setup -q -n %{module}-%{version}
48%patch0 -p1
49
50%{__sed} -i '1d' pip/__init__.py
51
52%if %{with python3}
53set -- *
54install -d py3
55cp -a "$@" py3
56%endif
57
58%build
59%{__python} setup.py build
60
61%if %{with python3}
62cd py3
63%{__python3} setup.py build
64%endif
65
66%install
67rm -rf $RPM_BUILD_ROOT
68
69%if %{with python3}
70cd py3
71%{__python3} setup.py install \
72 --optimize=2 \
73 --skip-build \
74 --root $RPM_BUILD_ROOT
75
76# Change the name of the python3 pip executable in order to not conflict with
77# the python2 executable
78mv $RPM_BUILD_ROOT%{_bindir}/pip $RPM_BUILD_ROOT%{__python}3-pip
79
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
83ln -s python3-pip $RPM_BUILD_ROOT%{_bindir}/pip-python3
84
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*
88cd -
89%endif
90
91%{__python} setup.py install \
92 --optimize=2 \
93 --skip-build \
94 --root $RPM_BUILD_ROOT
95
96%py_postclean
97
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*
101
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
105ln -s pip $RPM_BUILD_ROOT%{__python}-pip
106
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
110ln -s pip $RPM_BUILD_ROOT%{_bindir}/pip-python
111
112%clean
113rm -rf $RPM_BUILD_ROOT
114
115%files
116%defattr(644,root,root,755)
117%doc docs/*
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
123
124%if %{with python3}
125%files -n python3-pip
126%defattr(644,root,root,755)
127%doc docs/*
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
132%endif
This page took 0.13682 seconds and 4 git commands to generate.