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_with python3 # CPython 3.x module (built from python3-setuptools.spec)
9 %bcond_with 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
25 # keep 44.x here for python2 support
30 Group: Development/Languages/Python
31 #Source0Download: https://pypi.org/simple/setuptools/
32 Source0: https://files.pythonhosted.org/packages/source/s/setuptools/%{pypi_name}-%{version}.zip
33 # Source0-md5: 2c41f19cfd1f16a7d7bb23689921ac1b
34 URL: https://github.com/pypa/setuptools
35 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
36 BuildRequires: glibc-localedb-all
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
43 BuildRequires: python-packaging >= 19.2
44 BuildRequires: python-pyparsing >= 2.2.1
45 BuildRequires: python-six >= 1.10.0
47 BuildConflicts: python-distribute < 0.7
49 # https://raw.githubusercontent.com/pypa/setuptools/v%{version}/tests/requirements.txt
50 BuildRequires: python-coverage >= 4.5.1
51 BuildRequires: python-futures
52 BuildRequires: python-mock
53 BuildRequires: python-pip >= 19.1
54 BuildRequires: python-pytest >= 3.7
55 BuildRequires: python-pytest-cov >= 2.5.1
56 BuildRequires: python-pytest-fixture-config
57 BuildRequires: python-pytest-flake8
58 BuildRequires: python-pytest-virtualenv >= 1.2.7
59 BuildRequires: python-virtualenv >= 13.0.0
60 BuildRequires: python-wheel
64 BuildRequires: python3-modules >= 1:3.5
65 %if %{with system_libs}
66 # versions from pkg_resources/_vendor/vendored.txt
67 BuildRequires: python3-appdirs >= 1.4.3
68 BuildRequires: python3-packaging >= 19.2
69 BuildRequires: python3-pyparsing >= 2.2.1
70 BuildRequires: python3-six >= 1.10.0
72 BuildConflicts: python3-distribute < 0.7
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
80 BuildRequires: python3-pip >= 19.1
81 BuildRequires: python3-pytest >= 3.7
82 BuildRequires: python3-pytest-cov >= 2.5.1
83 BuildRequires: python3-pytest-fixture-config
84 BuildRequires: python3-pytest-flake8
85 BuildRequires: python3-pytest-virtualenv >= 1.2.7
86 BuildRequires: python3-virtualenv >= 13.0.0
87 BuildRequires: python3-wheel
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
97 BuildRequires: rpm-pythonprov
98 BuildRequires: rpmbuild(macros) >= 1.714
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
108 Obsoletes: python-distribute < 0.7
109 Obsoletes: python-setuptools-devel < 1:6.0
111 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
114 setuptools is a collection of enhancements to the Python distutils
115 that allow you to more easily build and distribute Python 2.x
116 packages, especially ones that have dependencies on other packages.
118 %description -l pl.UTF-8
119 setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający
120 łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x,
121 szczególnie tych mających zależności od innych pakietów.
123 Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do
124 uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla
127 %package -n python3-%{module}
128 Summary: A collection of enhancements to the Python distutils
129 Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils
130 Group: Libraries/Python
131 Requires: python3-modules >= 1:3.5
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
139 Obsoletes: python3-distribute < 0.7
141 %description -n python3-%{module}
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.
146 %description -n python3-%{module} -l pl.UTF-8
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.
151 %package -n easy_install
152 Summary: Python software installer (deprecated)
153 Summary(pl.UTF-8): Instalator oprogramowania napisanego w Pythonie (przestarzały)
154 Group: Libraries/Python
155 %if %{with python3_default}
156 Requires: python3-%{module} = %{epoch}:%{version}-%{release}
158 Requires: python-%{module} = %{epoch}:%{version}-%{release}
160 Conflicts: python-setuptools < 1:18.6.1-2
162 %description -n easy_install
163 Python software installer. It's deprecated in favour of pip.
165 %description -n easy_install -l pl.UTF-8
166 Instalator oprogramowania napisanego w Pythonie. Jest przestarzały,
167 aktualnym zamiennikiem jest pip.
170 Summary: %{module} API documentation
171 Summary(pl.UTF-8): Dokumentacja API %{module}
175 API documentation for %{module}.
177 %description apidocs -l pl.UTF-8
178 Dokumentacja API %{module}.
181 %setup -q -n %{module}-%{version}
183 %if %{with system_libs}
184 exit 1 # TODO: unvendor modules from pkg_resources/_vendor
192 %{?with_tests:%{__python} -m pytest pkg_resources/tests setuptools/tests tests}
199 %{?with_tests:%{__python3} -m pytest pkg_resources/tests setuptools/tests tests}
203 %{__make} -C docs html \
204 SPHINXBUILD=sphinx-build-2
208 rm -rf $RPM_BUILD_ROOT
217 # note: setuptools/command/easy_install.py expects setuptools/site-patch.py to exist
218 %py_postclean -x site-patch.py
221 %if %{with python3_default}
222 ln -sf easy_install-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
224 ln -sf easy_install-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
228 rm -rf $RPM_BUILD_ROOT
232 %defattr(644,root,root,755)
233 %doc CHANGES.rst LICENSE README.rst
234 %attr(755,root,root) %{_bindir}/easy_install-%{py_ver}
235 %{py_sitescriptdir}/pkg_resources
236 %{py_sitescriptdir}/setuptools
237 %{py_sitescriptdir}/easy_install.py[co]
238 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
242 %files -n python3-%{module}
243 %defattr(644,root,root,755)
244 %doc CHANGES.rst LICENSE README.rst
245 %attr(755,root,root) %{_bindir}/easy_install-%{py3_ver}
246 %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co]
247 %{py3_sitescriptdir}/pkg_resources
248 %{py3_sitescriptdir}/setuptools
249 %{py3_sitescriptdir}/easy_install.py
250 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
253 %files -n easy_install
254 %defattr(644,root,root,755)
255 %attr(755,root,root) %{_bindir}/easy_install
259 %defattr(644,root,root,755)
260 %doc docs/build/html/{_static,*.html,*.js}