]> git.pld-linux.org Git - packages/python-pip.git/blob - python-pip.spec
064fac4b81c5f615f4e63ce6808952c29a3887c9
[packages/python-pip.git] / python-pip.spec
1 # TODO
2 # - can these be removed on linux?
3 #   site-packages/pip/_vendor/distlib/t32.exe
4 #   site-packages/pip/_vendor/distlib/t64.exe
5 #   site-packages/pip/_vendor/distlib/w32.exe
6 #   site-packages/pip/_vendor/distlib/w64.exe
7 #
8 # Conditional build:
9 %bcond_without  python2         # CPython 3.x module
10 %bcond_without  python3         # CPython 3.x module
11 %bcond_without  python3_default # Use Python 3.x for pip executable
12 %bcond_without  apidocs         # Sphinx documentation
13 %bcond_with     tests           # test target (not included)
14
15 %if %{without python3}
16 %undefine       python3_default
17 %endif
18
19 %define         pypa_docs_theme_ver     d2e63fbfc62af3b7050f619b2f5bb8658985b931
20
21 %define         module          pip
22 %define         pypi_name       pip
23 Summary:        A tool for installing and managing Python 2 packages
24 Summary(pl.UTF-8):      Narzędzie do instalowania i zarządzania pakietami Pythona 2
25 Name:           python-%{module}
26 Version:        18.1
27 Release:        1
28 License:        MIT
29 Group:          Libraries/Python
30 # Source0Download: https://pypi.python.org/simple/pip/
31 Source0:        https://pypi.debian.net/pip/%{pypi_name}-%{version}.tar.gz
32 # Source0-md5:  75cad449ad62c88b22de317a26781714
33 Source2:        https://github.com/pypa/pypa-docs-theme/archive/%{pypa_docs_theme_ver}.tar.gz
34 # Source2-md5:  0261c95dc4e8bbbba674a512747ee1af
35 Source3:        https://github.com/python/python-docs-theme/archive/2018.2.tar.gz
36 # Source3-md5:  cb78b4116f7456070d39db0a3c5db16c
37 Patch0:         html_theme_path.patch
38 URL:            https://pip.pypa.io/
39 BuildRequires:  rpmbuild(macros) >= 1.710
40 %if %{with python2}
41 BuildRequires:  python-devel >= 1:2.6
42 BuildRequires:  python-modules >= 1:2.6
43 BuildRequires:  python-setuptools
44 %if %{with tests}
45 BuildRequires:  python-mock
46 BuildRequires:  python-pytest
47 BuildRequires:  python-scripttest >= 1.3
48 BuildRequires:  python-virtualenv >= 1.10
49 %endif
50 %endif
51 BuildRequires:  rpm-pythonprov
52 %{?with_apidocs:BuildRequires:  sphinx-pdg}
53 %if %{with python3}
54 BuildRequires:  python3-devel >= 1:3.2
55 BuildRequires:  python3-modules >= 1:3.2
56 BuildRequires:  python3-setuptools
57 %if %{with tests}
58 BuildRequires:  python3-mock
59 BuildRequires:  python3-pytest
60 BuildRequires:  python3-scripttest >= 1.3
61 BuildRequires:  python3-virtualenv >= 1.10
62 %endif
63 %endif
64 Requires:       python-setuptools
65 BuildArch:      noarch
66 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
68 %description
69 Pip is a replacement for easy_install. It uses mostly the same
70 techniques for finding packages, so packages that were made
71 easy_installable should be pip-installable as well.
72
73 %description -l pl.UTF-8
74 Pip to zamiennik easy_install. Wykorzystuje w większości te same
75 techniki do wyszukiwania pakietów, więc pakiety, które dało się
76 zainstalować przez easy_install, powinny także dać się zainstalować
77 przy użyciu pipa.
78
79 %package -n python3-pip
80 Summary:        A tool for installing and managing Python 3 packages
81 Summary(pl.UTF-8):      Narzędzie do instalowania i zarządzania pakietami Pythona 3
82 Group:          Libraries/Python
83 Requires:       python3-setuptools
84
85 %description -n python3-pip
86 Pip is a replacement for easy_install. It uses mostly the same
87 techniques for finding packages, so packages that were made
88 easy_installable should be pip-installable as well.
89
90 %description -n python3-pip -l pl.UTF-8
91 Pip to zamiennik easy_install. Wykorzystuje w większości te same
92 techniki do wyszukiwania pakietów, więc pakiety, które dało się
93 zainstalować przez easy_install, powinny także dać się zainstalować
94 przy użyciu pipa.
95
96 %package -n pip
97 Summary:        A tool for installing and managing Python 3 packages
98 Summary(pl.UTF-8):      Narzędzie do instalowania i zarządzania pakietami Pythona 3
99 Group:          Development/Tools
100 %if %{with python3_default}
101 Requires:       python3-%{module} = %{version}-%{release}
102 %else
103 Requires:       python-%{module} = %{version}-%{release}
104 %endif
105 Conflicts:      %{name} < 7.1.2-3
106
107 %description -n pip
108 Pip is a replacement for easy_install. It uses mostly the same
109 techniques for finding packages, so packages that were made
110 easy_installable should be pip-installable as well.
111
112 %description -n pip -l pl.UTF-8
113 Pip to zamiennik easy_install. Wykorzystuje w większości te same
114 techniki do wyszukiwania pakietów, więc pakiety, które dało się
115 zainstalować przez easy_install, powinny także dać się zainstalować
116 przy użyciu pipa.
117
118 %package apidocs
119 Summary:        Documentation for Python pip modules and installer
120 Summary(pl.UTF-8):      Dokumentacja instalatora i modułów Pythona pip
121 Group:          Documentation
122
123 %description apidocs
124 Documentation for Python pip modules and installer.
125
126 %description apidocs -l pl.UTF-8
127 Dokumentacja instalatora i modułów Pythona pip.
128
129 %prep
130 %setup -q -n %{module}-%{version}
131 %patch0 -p1
132 cd docs
133 tar -xf %{SOURCE2}
134 mv pypa-docs-theme-%{pypa_docs_theme_ver} pypa
135 tar -xf %{SOURCE3}
136 mv python-docs-theme-2018.2 python-docs-theme
137
138 %build
139 %if %{with python2}
140 %py_build %{?with_tests:test}
141 %endif
142
143 %if %{with python3}
144 %py3_build %{?with_tests:test}
145 %endif
146
147 %if %{with apidocs}
148 cd docs/html
149 export PYTHONPATH=$(pwd)/../../build-2/lib:$(pwd)/../../build-3/lib; sphinx-build -b html . _build/html
150 cd ../..
151 %endif
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155
156 %if %{with python3}
157 %py3_install
158
159 # RH compatibility
160 ln -sf pip3 $RPM_BUILD_ROOT%{_bindir}/python3-pip
161 %endif
162
163 %if %{with python2}
164 %py_install
165
166 %py_postclean
167
168 # RH compatibility
169 ln -sf pip2 $RPM_BUILD_ROOT%{_bindir}/python-pip
170 %endif
171
172 %if %{with python3_default}
173 ln -sf pip3 $RPM_BUILD_ROOT%{_bindir}/pip
174 %else
175 ln -sf pip2 $RPM_BUILD_ROOT%{_bindir}/pip
176 %endif
177
178 %clean
179 rm -rf $RPM_BUILD_ROOT
180
181 %if %{with python2}
182 %files
183 %defattr(644,root,root,755)
184 %doc AUTHORS.txt LICENSE.txt README.rst
185 %attr(755,root,root) %{_bindir}/pip2
186 %attr(755,root,root) %{_bindir}/pip2.*
187 %attr(755,root,root) %{_bindir}/python-pip
188 %{py_sitescriptdir}/pip-%{version}-py*.egg-info
189 %{py_sitescriptdir}/pip
190 %endif
191
192 %if %{with python3}
193 %files -n python3-pip
194 %defattr(644,root,root,755)
195 %doc AUTHORS.txt LICENSE.txt README.rst
196 %attr(755,root,root) %{_bindir}/pip3
197 %attr(755,root,root) %{_bindir}/pip3.*
198 %attr(755,root,root) %{_bindir}/python3-pip
199 %{py3_sitescriptdir}/pip
200 %{py3_sitescriptdir}/pip-%{version}-py*.egg-info
201 %endif
202
203 %files -n pip
204 %defattr(644,root,root,755)
205 %doc AUTHORS.txt LICENSE.txt README.rst
206 %attr(755,root,root) %{_bindir}/pip
207
208 %if %{with apidocs}
209 %files apidocs
210 %defattr(644,root,root,755)
211 %doc docs/html/_build/html/*
212 %endif
This page took 0.126386 seconds and 2 git commands to generate.