3 %bcond_without apidocs # Sphinx based documentation
4 %bcond_with system_libs # use system modules (appdirs, packaging, pyparsing, six) # TODO
5 %bcond_with tests # py.test tests (few failures)
6 %bcond_with bootstrap # convenience alias for without: apidocs,system_libs,tests
7 %bcond_without python2 # CPython 2.x module
8 %bcond_without python3 # CPython 3.x module
9 %bcond_without python3_default # Use Python 3.x for easy_install executable
11 %if %{without python3}
12 %undefine python3_default
15 %undefine with_apidocs
16 %undefine with_system_libs
20 %define module setuptools
21 %define pypi_name setuptools
22 Summary: A collection of enhancements to the Python distutils
23 Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils
24 Name: python-setuptools
29 Group: Development/Languages/Python
30 #Source0Download: https://pypi.org/simple/setuptools/
31 Source0: https://files.pythonhosted.org/packages/source/s/setuptools/%{pypi_name}-%{version}.zip
32 # Source0-md5: 12f8546ead968a0c237732d53fe7fcb1
33 URL: https://github.com/pypa/setuptools
34 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
35 BuildRequires: glibc-localedb-all
38 BuildRequires: python-modules >= 1:2.7
39 %if %{with system_libs}
40 # versions from pkg_resources/_vendor/vendored.txt
41 BuildRequires: python-appdirs >= 1.4.3
42 BuildRequires: python-packaging >= 16.8
43 BuildRequires: python-pyparsing >= 2.2.1
44 BuildRequires: python-six >= 1.10.0
46 BuildConflicts: python-distribute < 0.7
48 BuildRequires: python-coverage >= 4.5.1
49 BuildRequires: python-mock
50 BuildRequires: python-pytest >= 3.0.2
51 BuildRequires: python-pytest-cov >= 2.5.1
52 BuildRequires: python-pytest-fixture-config
53 BuildRequires: python-pytest-flake8
54 BuildRequires: python-pytest-virtualenv >= 1.2.7
55 BuildRequires: python-virtualenv >= 13.0.0
56 BuildRequires: python-wheel
60 BuildRequires: python3-modules >= 1:3.4
61 %if %{with system_libs}
62 # versions from pkg_resources/_vendor/vendored.txt
63 BuildRequires: python3-appdirs >= 1.4.3
64 BuildRequires: python3-packaging >= 16.8
65 BuildRequires: python3-pyparsing >= 2.2.1
66 BuildRequires: python3-six >= 1.10.0
68 BuildConflicts: python3-distribute < 0.7
70 BuildRequires: python3-coverage >= 4.5.1
71 # FIXME: patch to use unittest.mock
72 #BuildRequires: python3-mock
73 %if "%{py3_ver}" >= "3.6"
74 BuildRequires: python3-paver
76 BuildRequires: python3-pytest >= 3.0.2
77 BuildRequires: python3-pytest-cov >= 2.5.1
78 BuildRequires: python3-pytest-fixture-config
79 BuildRequires: python3-pytest-flake8
80 BuildRequires: python3-pytest-virtualenv >= 1.2.7
81 BuildRequires: python3-virtualenv >= 13.0.0
82 BuildRequires: python3-wheel
86 BuildRequires: python3-jaraco
87 BuildRequires: python3-jaraco.packaging >= 3.2
88 BuildRequires: python3-rst.linker >= 1.9
89 BuildRequires: python3-setuptools >= 34
90 BuildRequires: sphinx-pdg-3 >= 1.4
92 BuildRequires: rpm-pythonprov
93 BuildRequires: rpmbuild(macros) >= 1.714
95 Requires: python-modules >= 1:2.7
96 %if %{with system_libs}
97 # versions from pkg_resources/_vendor/vendored.txt
98 Requires: python-appdirs >= 1.4.0
99 Requires: python-packaging >= 16.8
100 Requires: python-pyparsing >= 2.1.10
101 Requires: python-six >= 1.10.0
103 Obsoletes: python-distribute < 0.7
104 Obsoletes: python-setuptools-devel
106 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
109 setuptools is a collection of enhancements to the Python distutils
110 that allow you to more easily build and distribute Python 2.x
111 packages, especially ones that have dependencies on other packages.
113 %description -l pl.UTF-8
114 setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający
115 łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x,
116 szczególnie tych mających zależności od innych pakietów.
118 Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do
119 uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla
122 %package -n python3-%{module}
123 Summary: A collection of enhancements to the Python distutils
124 Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils
125 Group: Libraries/Python
126 Requires: python3-modules >= 1:3.4
127 %if %{with system_libs}
128 # versions from pkg_resources/_vendor/vendored.txt
129 Requires: python3-appdirs >= 1.4.0
130 Requires: python3-packaging >= 16.8
131 Requires: python3-pyparsing >= 2.1.10
132 Requires: python3-six >= 1.10.0
134 Obsoletes: python3-distribute < 0.7
136 %description -n python3-%{module}
137 setuptools is a collection of enhancements to the Python distutils
138 that allow you to more easily build and distribute Python 3.x
139 packages, especially ones that have dependencies on other packages.
141 %description -n python3-%{module} -l pl.UTF-8
142 setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający
143 łatwiejsze budowanie i rozprowadzanie pakietów Pythona 3.x,
144 szczególnie tych mających zależności od innych pakietów.
146 %package -n easy_install
147 Summary: Python software installer
148 Summary(pl.UTF-8): Instalator oprogramowania napisanego w Pythonie
149 Group: Libraries/Python
150 %if %{with python3_default}
151 Requires: python3-%{module} = %{epoch}:%{version}-%{release}
153 Requires: python-%{module} = %{epoch}:%{version}-%{release}
155 Conflicts: python-setuptools < 1:18.6.1-2
157 %description -n easy_install
158 Python software installer.
160 %description -n easy_install -l pl.UTF-8
161 Instalator oprogramowania napisanego w Pythonie.
164 Summary: %{module} API documentation
165 Summary(pl.UTF-8): Dokumentacja API %{module}
169 API documentation for %{module}.
171 %description apidocs -l pl.UTF-8
172 Dokumentacja API %{module}.
175 %setup -q -n %{module}-%{version}
177 %if %{with system_libs}
178 exit 1 # TODO: unvendor modules from pkg_resources/_vendor
186 %{?with_tests:%{__python} -m pytest pkg_resources/tests setuptools/tests tests}
193 %{?with_tests:%{__python3} -m pytest pkg_resources/tests setuptools/tests tests}
197 %{__make} -C docs html SPHINXBUILD=sphinx-build-3
201 rm -rf $RPM_BUILD_ROOT
210 # note: setuptools/command/easy_install.py expects setuptools/site-patch.py to exist
211 %py_postclean -x site-patch.py
214 %if %{with python3_default}
215 ln -sf easy_install-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
217 ln -sf easy_install-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
221 rm -rf $RPM_BUILD_ROOT
225 %defattr(644,root,root,755)
226 %doc CHANGES.rst LICENSE README.rst
227 %attr(755,root,root) %{_bindir}/easy_install-%{py_ver}
228 %{py_sitescriptdir}/pkg_resources
229 %{py_sitescriptdir}/setuptools
230 %{py_sitescriptdir}/easy_install.py[co]
231 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
235 %files -n python3-%{module}
236 %defattr(644,root,root,755)
237 %doc CHANGES.rst LICENSE README.rst
238 %attr(755,root,root) %{_bindir}/easy_install-%{py3_ver}
239 %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co]
240 %{py3_sitescriptdir}/pkg_resources
241 %{py3_sitescriptdir}/setuptools
242 %{py3_sitescriptdir}/easy_install.py
243 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
246 %files -n easy_install
247 %defattr(644,root,root,755)
248 %attr(755,root,root) %{_bindir}/easy_install
252 %defattr(644,root,root,755)
253 %doc docs/build/html/{_static,*.html,*.js}