]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without apidocs # Sphinx based documentation | |
4 | %bcond_with tests # py.test tests (few failures) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | %bcond_without python3_default # Use Python 3.x for easy_install executable | |
8 | ||
9 | %if %{without python3} | |
10 | %undefine python3_default | |
11 | %endif | |
12 | ||
13 | %define module setuptools | |
14 | Summary: A collection of enhancements to the Python distutils | |
15 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils | |
16 | Name: python-setuptools | |
17 | Version: 40.2.0 | |
18 | Release: 1 | |
19 | Epoch: 1 | |
20 | License: PSF or ZPL | |
21 | Group: Development/Languages/Python | |
22 | #Source0Download: https://pypi.python.org/simple/setuptools/ | |
23 | Source0: https://files.pythonhosted.org/packages/ef/1d/201c13e353956a1c840f5d0fbf0461bd45bbd678ea4843ebf25924e8984c/setuptools-%{version}.zip | |
24 | # Source0-md5: 592efabea3a65d8e97a025ed52f69b12 | |
25 | URL: https://github.com/pypa/setuptools | |
26 | %if %(locale -a | grep -q '^C.UTF-8$'; echo $?) | |
27 | BuildRequires: glibc-localedb-all | |
28 | %endif | |
29 | %if %{with python2} | |
30 | BuildRequires: python-appdirs >= 1.4.0 | |
31 | BuildRequires: python-modules >= 1:2.6 | |
32 | BuildRequires: python-packaging >= 16.8 | |
33 | BuildConflicts: python-distribute < 0.7 | |
34 | BuildRequires: python-six >= 1.6.0 | |
35 | %if %{with tests} | |
36 | BuildRequires: python-backports.unittest_mock >= 1.2 | |
37 | BuildRequires: python-pytest >= 3.0.2 | |
38 | BuildRequires: python-pytest-flake8 | |
39 | %endif | |
40 | %endif | |
41 | %if %{with python3} | |
42 | BuildRequires: python3-appdirs >= 1.4.0 | |
43 | BuildRequires: python3-modules >= 1:3.3 | |
44 | BuildRequires: python3-packaging >= 16.8 | |
45 | BuildRequires: python3-six >= 1.6.0 | |
46 | BuildConflicts: python3-distribute < 0.7 | |
47 | %if %{with tests} | |
48 | BuildRequires: python3-pytest >= 3.0.2 | |
49 | BuildRequires: python3-pytest-flake8 | |
50 | %endif | |
51 | %endif | |
52 | %if %{with apidocs} | |
53 | BuildRequires: python3-jaraco | |
54 | BuildRequires: python3-jaraco.packaging | |
55 | BuildRequires: python3-rst.linker >= 1.6.1 | |
56 | BuildRequires: sphinx-pdg-3 >= 1.4 | |
57 | %endif | |
58 | BuildRequires: rpm-pythonprov | |
59 | BuildRequires: rpmbuild(macros) >= 1.714 | |
60 | BuildRequires: unzip | |
61 | Requires: python-modules >= 1:2.6 | |
62 | Obsoletes: python-distribute < 0.7 | |
63 | Obsoletes: python-setuptools-devel | |
64 | BuildArch: noarch | |
65 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
66 | ||
67 | %description | |
68 | setuptools is a collection of enhancements to the Python distutils | |
69 | that allow you to more easily build and distribute Python 2.x | |
70 | packages, especially ones that have dependencies on other packages. | |
71 | ||
72 | %description -l pl.UTF-8 | |
73 | setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający | |
74 | łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x, | |
75 | szczególnie tych mających zależności od innych pakietów. | |
76 | ||
77 | Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do | |
78 | uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla | |
79 | Pythona 2.x. | |
80 | ||
81 | %package -n python3-%{module} | |
82 | Summary: A collection of enhancements to the Python distutils | |
83 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils | |
84 | Group: Libraries/Python | |
85 | Requires: python3-modules >= 1:3.3 | |
86 | Obsoletes: python3-distribute < 0.7 | |
87 | ||
88 | %description -n python3-%{module} | |
89 | setuptools is a collection of enhancements to the Python distutils | |
90 | that allow you to more easily build and distribute Python 3.x | |
91 | packages, especially ones that have dependencies on other packages. | |
92 | ||
93 | %description -n python3-%{module} -l pl.UTF-8 | |
94 | setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający | |
95 | łatwiejsze budowanie i rozprowadzanie pakietów Pythona 3.x, | |
96 | szczególnie tych mających zależności od innych pakietów. | |
97 | ||
98 | %package -n easy_install | |
99 | Summary: Python software installer | |
100 | Summary(pl.UTF-8): Instalator oprogramowania napisanego w Pythonie | |
101 | Group: Libraries/Python | |
102 | %if %{with python3_default} | |
103 | Requires: python3-%{module} = %{epoch}:%{version}-%{release} | |
104 | %else | |
105 | Requires: python-%{module} = %{epoch}:%{version}-%{release} | |
106 | %endif | |
107 | Conflicts: python-setuptools < 1:18.6.1-2 | |
108 | ||
109 | %description -n easy_install | |
110 | Python software installer. | |
111 | ||
112 | %description -n easy_install -l pl.UTF-8 | |
113 | Instalator oprogramowania napisanego w Pythonie. | |
114 | ||
115 | %package apidocs | |
116 | Summary: %{module} API documentation | |
117 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
118 | Group: Documentation | |
119 | ||
120 | %description apidocs | |
121 | API documentation for %{module}. | |
122 | ||
123 | %description apidocs -l pl.UTF-8 | |
124 | Dokumentacja API %{module}. | |
125 | ||
126 | %prep | |
127 | %setup -q -n %{module}-%{version} | |
128 | ||
129 | %build | |
130 | %if %{with python2} | |
131 | LC_ALL=C.UTF-8 \ | |
132 | %py_build | |
133 | ||
134 | %{?with_tests:%{__python} -m pytest pkg_resources/tests setuptools/tests tests} | |
135 | %endif | |
136 | ||
137 | %if %{with python3} | |
138 | LC_ALL=C.UTF-8 \ | |
139 | %py3_build | |
140 | ||
141 | %{?with_tests:%{__python3} -m pytest pkg_resources/tests setuptools/tests tests} | |
142 | %endif | |
143 | ||
144 | %if %{with apidocs} | |
145 | %{__make} -C docs html SPHINXBUILD=sphinx-build-3 | |
146 | %endif | |
147 | ||
148 | %install | |
149 | rm -rf $RPM_BUILD_ROOT | |
150 | ||
151 | %if %{with python3} | |
152 | %py3_install | |
153 | %endif | |
154 | ||
155 | %if %{with python2} | |
156 | %py_install | |
157 | ||
158 | # note: setuptools/command/easy_install.py expects setuptools/site-patch.py to exist | |
159 | %py_postclean -x site-patch.py | |
160 | %endif | |
161 | ||
162 | %if %{with python3_default} | |
163 | ln -sf easy_install-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install | |
164 | %else | |
165 | ln -sf easy_install-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install | |
166 | %endif | |
167 | ||
168 | %clean | |
169 | rm -rf $RPM_BUILD_ROOT | |
170 | ||
171 | %if %{with python2} | |
172 | %files | |
173 | %defattr(644,root,root,755) | |
174 | %doc CHANGES.rst README.rst | |
175 | %attr(755,root,root) %{_bindir}/easy_install-%{py_ver} | |
176 | %{py_sitescriptdir}/pkg_resources | |
177 | %{py_sitescriptdir}/setuptools | |
178 | %{py_sitescriptdir}/easy_install.py[co] | |
179 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
180 | %endif | |
181 | ||
182 | %if %{with python3} | |
183 | %files -n python3-%{module} | |
184 | %defattr(644,root,root,755) | |
185 | %doc CHANGES.rst README.rst | |
186 | %attr(755,root,root) %{_bindir}/easy_install-%{py3_ver} | |
187 | %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co] | |
188 | %{py3_sitescriptdir}/pkg_resources | |
189 | %{py3_sitescriptdir}/setuptools | |
190 | %{py3_sitescriptdir}/easy_install.py | |
191 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
192 | %endif | |
193 | ||
194 | %files -n easy_install | |
195 | %defattr(644,root,root,755) | |
196 | %attr(755,root,root) %{_bindir}/easy_install | |
197 | ||
198 | %if %{with apidocs} | |
199 | %files apidocs | |
200 | %defattr(644,root,root,755) | |
201 | %doc docs/build/html/{_static,*.html,*.js} | |
202 | %endif |