]>
Commit | Line | Data |
---|---|---|
2f649423 MK |
1 | # |
2 | # Conditional build: | |
e2cd79ed | 3 | %bcond_without apidocs # Sphinx based documentation |
744badc2 | 4 | %bcond_with system_libs # use system modules (appdirs, packaging, pyparsing, six) # TODO |
6502ae9a | 5 | %bcond_with tests # py.test tests (few failures) |
744badc2 | 6 | %bcond_with bootstrap # convenience alias for without: apidocs,system_libs,tests |
e2cd79ed | 7 | %bcond_without python2 # CPython 2.x module |
0013c3df | 8 | %bcond_with python3 # CPython 3.x module (built from python3-setuptools.spec) |
2dde3f61 | 9 | %bcond_with python3_default # Use Python 3.x for easy_install executable |
25fb9ea9 JK |
10 | |
11 | %if %{without python3} | |
12 | %undefine python3_default | |
13 | %endif | |
744badc2 JB |
14 | %if %{with bootstrap} |
15 | %undefine with_apidocs | |
16 | %undefine with_system_libs | |
17 | %undefine with_tests | |
18 | %endif | |
2f649423 | 19 | |
744badc2 | 20 | %define module setuptools |
9fded6eb | 21 | %define pypi_name setuptools |
b79e62bc | 22 | Summary: A collection of enhancements to the Python distutils |
e4a6c4e2 | 23 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils |
b79e62bc | 24 | Name: python-setuptools |
0013c3df JB |
25 | # keep 44.x here for python2 support |
26 | Version: 44.1.1 | |
27 | Release: 1 | |
67093d8e | 28 | Epoch: 1 |
744badc2 | 29 | License: MIT |
b79e62bc | 30 | Group: Development/Languages/Python |
744badc2 JB |
31 | #Source0Download: https://pypi.org/simple/setuptools/ |
32 | Source0: https://files.pythonhosted.org/packages/source/s/setuptools/%{pypi_name}-%{version}.zip | |
0013c3df | 33 | # Source0-md5: 2c41f19cfd1f16a7d7bb23689921ac1b |
1ca207b5 | 34 | URL: https://github.com/pypa/setuptools |
744badc2 | 35 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) |
c034c756 JB |
36 | BuildRequires: glibc-localedb-all |
37 | %endif | |
2f649423 | 38 | %if %{with python2} |
744badc2 JB |
39 | BuildRequires: python-modules >= 1:2.7 |
40 | %if %{with system_libs} | |
41 | # versions from pkg_resources/_vendor/vendored.txt | |
42 | BuildRequires: python-appdirs >= 1.4.3 | |
403a922f | 43 | BuildRequires: python-packaging >= 19.2 |
744badc2 JB |
44 | BuildRequires: python-pyparsing >= 2.2.1 |
45 | BuildRequires: python-six >= 1.10.0 | |
46 | %endif | |
b6cbc91d | 47 | BuildConflicts: python-distribute < 0.7 |
e2cd79ed | 48 | %if %{with tests} |
403a922f | 49 | # https://raw.githubusercontent.com/pypa/setuptools/v%{version}/tests/requirements.txt |
744badc2 | 50 | BuildRequires: python-coverage >= 4.5.1 |
ac973a26 | 51 | BuildRequires: python-futures |
744badc2 | 52 | BuildRequires: python-mock |
403a922f | 53 | BuildRequires: python-pip >= 19.1 |
ac973a26 | 54 | BuildRequires: python-pytest >= 3.7 |
744badc2 JB |
55 | BuildRequires: python-pytest-cov >= 2.5.1 |
56 | BuildRequires: python-pytest-fixture-config | |
6502ae9a | 57 | BuildRequires: python-pytest-flake8 |
744badc2 JB |
58 | BuildRequires: python-pytest-virtualenv >= 1.2.7 |
59 | BuildRequires: python-virtualenv >= 13.0.0 | |
60 | BuildRequires: python-wheel | |
e2cd79ed | 61 | %endif |
2f649423 MK |
62 | %endif |
63 | %if %{with python3} | |
0013c3df | 64 | BuildRequires: python3-modules >= 1:3.5 |
744badc2 JB |
65 | %if %{with system_libs} |
66 | # versions from pkg_resources/_vendor/vendored.txt | |
67 | BuildRequires: python3-appdirs >= 1.4.3 | |
403a922f | 68 | BuildRequires: python3-packaging >= 19.2 |
744badc2 JB |
69 | BuildRequires: python3-pyparsing >= 2.2.1 |
70 | BuildRequires: python3-six >= 1.10.0 | |
71 | %endif | |
b6cbc91d | 72 | BuildConflicts: python3-distribute < 0.7 |
e2cd79ed | 73 | %if %{with tests} |
744badc2 JB |
74 | BuildRequires: python3-coverage >= 4.5.1 |
75 | # FIXME: patch to use unittest.mock | |
76 | #BuildRequires: python3-mock | |
77 | %if "%{py3_ver}" >= "3.6" | |
78 | BuildRequires: python3-paver | |
79 | %endif | |
403a922f | 80 | BuildRequires: python3-pip >= 19.1 |
ac973a26 | 81 | BuildRequires: python3-pytest >= 3.7 |
744badc2 JB |
82 | BuildRequires: python3-pytest-cov >= 2.5.1 |
83 | BuildRequires: python3-pytest-fixture-config | |
6502ae9a | 84 | BuildRequires: python3-pytest-flake8 |
744badc2 JB |
85 | BuildRequires: python3-pytest-virtualenv >= 1.2.7 |
86 | BuildRequires: python3-virtualenv >= 13.0.0 | |
87 | BuildRequires: python3-wheel | |
e2cd79ed | 88 | %endif |
2f649423 | 89 | %endif |
5c02125b | 90 | %if %{with apidocs} |
f02432f9 JB |
91 | BuildRequires: python-jaraco |
92 | BuildRequires: python-jaraco.packaging >= 6.1 | |
93 | BuildRequires: python-rst.linker >= 1.9 | |
94 | BuildRequires: python-setuptools >= 1:34 | |
95 | BuildRequires: sphinx-pdg-2 >= 1.4 | |
5c02125b | 96 | %endif |
c034c756 | 97 | BuildRequires: rpm-pythonprov |
6502ae9a | 98 | BuildRequires: rpmbuild(macros) >= 1.714 |
6ef7e1f8 | 99 | BuildRequires: unzip |
744badc2 JB |
100 | Requires: python-modules >= 1:2.7 |
101 | %if %{with system_libs} | |
102 | # versions from pkg_resources/_vendor/vendored.txt | |
103 | Requires: python-appdirs >= 1.4.0 | |
104 | Requires: python-packaging >= 16.8 | |
105 | Requires: python-pyparsing >= 2.1.10 | |
106 | Requires: python-six >= 1.10.0 | |
107 | %endif | |
64c5aa5e | 108 | Obsoletes: python-distribute < 0.7 |
1ca67bdd | 109 | Obsoletes: python-setuptools-devel < 1:6.0 |
b79e62bc AM |
110 | BuildArch: noarch |
111 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
112 | ||
113 | %description | |
114 | setuptools is a collection of enhancements to the Python distutils | |
c034c756 JB |
115 | that allow you to more easily build and distribute Python 2.x |
116 | packages, especially ones that have dependencies on other packages. | |
b79e62bc | 117 | |
1c17442b | 118 | %description -l pl.UTF-8 |
d539774b | 119 | setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający |
c034c756 JB |
120 | łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x, |
121 | szczególnie tych mających zależności od innych pakietów. | |
d539774b JB |
122 | |
123 | Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do | |
c034c756 JB |
124 | uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla |
125 | Pythona 2.x. | |
eadb908c | 126 | |
2f649423 | 127 | %package -n python3-%{module} |
c034c756 JB |
128 | Summary: A collection of enhancements to the Python distutils |
129 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils | |
2f649423 | 130 | Group: Libraries/Python |
0013c3df | 131 | Requires: python3-modules >= 1:3.5 |
744badc2 JB |
132 | %if %{with system_libs} |
133 | # versions from pkg_resources/_vendor/vendored.txt | |
134 | Requires: python3-appdirs >= 1.4.0 | |
135 | Requires: python3-packaging >= 16.8 | |
136 | Requires: python3-pyparsing >= 2.1.10 | |
137 | Requires: python3-six >= 1.10.0 | |
138 | %endif | |
ff466203 | 139 | Obsoletes: python3-distribute < 0.7 |
2f649423 MK |
140 | |
141 | %description -n python3-%{module} | |
c034c756 JB |
142 | setuptools is a collection of enhancements to the Python distutils |
143 | that allow you to more easily build and distribute Python 3.x | |
144 | packages, especially ones that have dependencies on other packages. | |
2f649423 MK |
145 | |
146 | %description -n python3-%{module} -l pl.UTF-8 | |
c034c756 JB |
147 | setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający |
148 | łatwiejsze budowanie i rozprowadzanie pakietów Pythona 3.x, | |
149 | szczególnie tych mających zależności od innych pakietów. | |
2f649423 | 150 | |
25fb9ea9 | 151 | %package -n easy_install |
403a922f JB |
152 | Summary: Python software installer (deprecated) |
153 | Summary(pl.UTF-8): Instalator oprogramowania napisanego w Pythonie (przestarzały) | |
25fb9ea9 JK |
154 | Group: Libraries/Python |
155 | %if %{with python3_default} | |
156 | Requires: python3-%{module} = %{epoch}:%{version}-%{release} | |
157 | %else | |
158 | Requires: python-%{module} = %{epoch}:%{version}-%{release} | |
159 | %endif | |
b6cbc91d | 160 | Conflicts: python-setuptools < 1:18.6.1-2 |
25fb9ea9 JK |
161 | |
162 | %description -n easy_install | |
403a922f | 163 | Python software installer. It's deprecated in favour of pip. |
25fb9ea9 | 164 | |
23dd6491 | 165 | %description -n easy_install -l pl.UTF-8 |
403a922f JB |
166 | Instalator oprogramowania napisanego w Pythonie. Jest przestarzały, |
167 | aktualnym zamiennikiem jest pip. | |
25fb9ea9 | 168 | |
2f649423 MK |
169 | %package apidocs |
170 | Summary: %{module} API documentation | |
171 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
172 | Group: Documentation | |
173 | ||
174 | %description apidocs | |
175 | API documentation for %{module}. | |
176 | ||
177 | %description apidocs -l pl.UTF-8 | |
178 | Dokumentacja API %{module}. | |
179 | ||
b79e62bc | 180 | %prep |
2f649423 | 181 | %setup -q -n %{module}-%{version} |
b79e62bc | 182 | |
744badc2 JB |
183 | %if %{with system_libs} |
184 | exit 1 # TODO: unvendor modules from pkg_resources/_vendor | |
185 | %endif | |
186 | ||
b79e62bc | 187 | %build |
2f649423 | 188 | %if %{with python2} |
6502ae9a JB |
189 | LC_ALL=C.UTF-8 \ |
190 | %py_build | |
191 | ||
192 | %{?with_tests:%{__python} -m pytest pkg_resources/tests setuptools/tests tests} | |
2f649423 MK |
193 | %endif |
194 | ||
195 | %if %{with python3} | |
6502ae9a JB |
196 | LC_ALL=C.UTF-8 \ |
197 | %py3_build | |
198 | ||
199 | %{?with_tests:%{__python3} -m pytest pkg_resources/tests setuptools/tests tests} | |
2f649423 | 200 | %endif |
b79e62bc | 201 | |
c034c756 | 202 | %if %{with apidocs} |
f02432f9 JB |
203 | %{__make} -C docs html \ |
204 | SPHINXBUILD=sphinx-build-2 | |
c034c756 JB |
205 | %endif |
206 | ||
b79e62bc AM |
207 | %install |
208 | rm -rf $RPM_BUILD_ROOT | |
209 | ||
c034c756 | 210 | %if %{with python3} |
a21b5be7 | 211 | %py3_install |
2f649423 | 212 | %endif |
991fba2b | 213 | |
c034c756 | 214 | %if %{with python2} |
a21b5be7 | 215 | %py_install |
c034c756 | 216 | |
4ba39be8 JB |
217 | # note: setuptools/command/easy_install.py expects setuptools/site-patch.py to exist |
218 | %py_postclean -x site-patch.py | |
2f649423 | 219 | %endif |
b79e62bc | 220 | |
25fb9ea9 | 221 | %if %{with python3_default} |
b6cbc91d | 222 | ln -sf easy_install-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install |
25fb9ea9 | 223 | %else |
b6cbc91d | 224 | ln -sf easy_install-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install |
25fb9ea9 JK |
225 | %endif |
226 | ||
b79e62bc AM |
227 | %clean |
228 | rm -rf $RPM_BUILD_ROOT | |
229 | ||
2f649423 | 230 | %if %{with python2} |
b79e62bc AM |
231 | %files |
232 | %defattr(644,root,root,755) | |
744badc2 | 233 | %doc CHANGES.rst LICENSE README.rst |
25fb9ea9 | 234 | %attr(755,root,root) %{_bindir}/easy_install-%{py_ver} |
5c02125b JB |
235 | %{py_sitescriptdir}/pkg_resources |
236 | %{py_sitescriptdir}/setuptools | |
2f649423 | 237 | %{py_sitescriptdir}/easy_install.py[co] |
2f649423 MK |
238 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
239 | %endif | |
2f649423 MK |
240 | |
241 | %if %{with python3} | |
242 | %files -n python3-%{module} | |
f4841952 | 243 | %defattr(644,root,root,755) |
744badc2 | 244 | %doc CHANGES.rst LICENSE README.rst |
25fb9ea9 | 245 | %attr(755,root,root) %{_bindir}/easy_install-%{py3_ver} |
c034c756 | 246 | %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co] |
5c02125b JB |
247 | %{py3_sitescriptdir}/pkg_resources |
248 | %{py3_sitescriptdir}/setuptools | |
2f649423 | 249 | %{py3_sitescriptdir}/easy_install.py |
2f649423 MK |
250 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
251 | %endif | |
252 | ||
25fb9ea9 JK |
253 | %files -n easy_install |
254 | %defattr(644,root,root,755) | |
255 | %attr(755,root,root) %{_bindir}/easy_install | |
256 | ||
c034c756 | 257 | %if %{with apidocs} |
2f649423 MK |
258 | %files apidocs |
259 | %defattr(644,root,root,755) | |
6502ae9a | 260 | %doc docs/build/html/{_static,*.html,*.js} |
2f649423 | 261 | %endif |