3 %bcond_without apidocs # Sphinx based documentation
4 %bcond_with tests # "test" action (fails, pytest-runner doesn't support build-base)
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
10 %undefine python3_default
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
21 Group: Development/Languages/Python
22 #Source0Download: https://pypi.python.org/simple/setuptools/
23 Source0: https://pypi.python.org/packages/ff/d4/209f4939c49e31f5524fa0027bf1c8ec3107abaf7c61fdaad704a648c281/setuptools-%{version}.tar.gz
24 # Source0-md5: 81964fdb89534118707742e6d1a1ddb4
25 Patch0: %{name}-missing.patch
26 URL: https://github.com/pypa/setuptools
27 %if %(locale -a | grep -q '^en_US.UTF-8$'; echo $?)
28 BuildRequires: glibc-localedb-all
31 BuildRequires: python-modules >= 1:2.6
32 BuildConflicts: python-distribute < 0.7
34 BuildRequires: python-mock
35 BuildRequires: python-pytest >= 2.8
36 BuildRequires: python-pytest-runner
40 BuildRequires: python3-modules >= 1:3.2
41 BuildConflicts: python3-distribute < 0.7
43 %if "%{py3_ver}" < "3.3"
44 BuildRequires: python3-mock
46 BuildRequires: python3-pytest >= 2.8
47 BuildRequires: python3-pytest-runner
51 BuildRequires: python3-rst.linker >= 1.4
52 BuildRequires: sphinx-pdg-3
54 BuildRequires: rpm-pythonprov
55 BuildRequires: rpmbuild(macros) >= 1.710
56 Requires: python-modules >= 1:2.6
57 Obsoletes: python-distribute < 0.7
58 Obsoletes: python-setuptools-devel
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 setuptools is a collection of enhancements to the Python distutils
64 that allow you to more easily build and distribute Python 2.x
65 packages, especially ones that have dependencies on other packages.
67 %description -l pl.UTF-8
68 setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający
69 łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x,
70 szczególnie tych mających zależności od innych pakietów.
72 Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do
73 uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla
76 %package -n python3-%{module}
77 Summary: A collection of enhancements to the Python distutils
78 Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils
79 Group: Libraries/Python
80 Requires: python3-modules >= 1:3.2
81 Obsoletes: python3-distribute < 0.7
83 %description -n python3-%{module}
84 setuptools is a collection of enhancements to the Python distutils
85 that allow you to more easily build and distribute Python 3.x
86 packages, especially ones that have dependencies on other packages.
88 %description -n python3-%{module} -l pl.UTF-8
89 setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający
90 łatwiejsze budowanie i rozprowadzanie pakietów Pythona 3.x,
91 szczególnie tych mających zależności od innych pakietów.
93 %package -n easy_install
94 Summary: Python software installer
95 Summary(pl.UTF-8): Instalator oprogramowania napisanego w Pythonie
96 Group: Libraries/Python
97 %if %{with python3_default}
98 Requires: python3-%{module} = %{epoch}:%{version}-%{release}
100 Requires: python-%{module} = %{epoch}:%{version}-%{release}
102 Conflicts: python-setuptools < 1:18.6.1-2
104 %description -n easy_install
105 Python software installer.
107 %description -n easy_install -l pl.UTF-8
108 Instalator oprogramowania napisanego w Pythonie.
111 Summary: %{module} API documentation
112 Summary(pl.UTF-8): Dokumentacja API %{module}
116 API documentation for %{module}.
118 %description apidocs -l pl.UTF-8
119 Dokumentacja API %{module}.
122 %setup -q -n %{module}-%{version}
128 %py_build %{?with_tests:test}
133 %py3_build %{?with_tests:test}
137 #%{__make} -C docs html SPHINXBUILD=sphinx-build-3
138 # rst.linker needs sphinx-build to be run from directory containing "CHANGES.txt"
139 sphinx-build-3 -b html -d build/doctrees -D latex_paper_size=a4 docs build/html
143 rm -rf $RPM_BUILD_ROOT
152 # note: setuptools/command/easy_install.py expects setuptools/site-patch.py to exist
153 %py_postclean -x site-patch.py
156 %if %{with python3_default}
157 ln -sf easy_install-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
159 ln -sf easy_install-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
163 rm -rf $RPM_BUILD_ROOT
167 %defattr(644,root,root,755)
168 %doc CHANGES.rst README.rst
169 %attr(755,root,root) %{_bindir}/easy_install-%{py_ver}
170 %{py_sitescriptdir}/pkg_resources
171 %{py_sitescriptdir}/setuptools
172 %{py_sitescriptdir}/easy_install.py[co]
173 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
177 %files -n python3-%{module}
178 %defattr(644,root,root,755)
179 %doc CHANGES.rst README.rst
180 %attr(755,root,root) %{_bindir}/easy_install-%{py3_ver}
181 %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co]
182 %{py3_sitescriptdir}/pkg_resources
183 %{py3_sitescriptdir}/setuptools
184 %{py3_sitescriptdir}/easy_install.py
185 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
188 %files -n easy_install
189 %defattr(644,root,root,755)
190 %attr(755,root,root) %{_bindir}/easy_install
194 %defattr(644,root,root,755)