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/source/s/setuptools/setuptools-%{version}.tar.gz
24 # Source0-md5: 7e4ba5cdebc02710d3ab748c103fc673
25 URL: https://bitbucket.org/pypa/setuptools
26 %if %(locale -a | grep -q '^en_US.UTF-8$'; echo $?)
27 BuildRequires: glibc-localedb-all
30 BuildRequires: python-modules >= 1:2.6
31 BuildConflicts: python-distribute < 0.7
33 BuildRequires: python-mock
34 BuildRequires: python-pytest >= 2.8
35 BuildRequires: python-pytest-runner
39 BuildRequires: python3-modules >= 1:3.2
40 BuildConflicts: python3-distribute < 0.7
42 %if "%{py3_ver}" < "3.3"
43 BuildRequires: python3-mock
45 BuildRequires: python3-pytest >= 2.8
46 BuildRequires: python3-pytest-runner
50 BuildRequires: python3-rst.linker >= 1.4
51 BuildRequires: sphinx-pdg-3
53 BuildRequires: rpm-pythonprov
54 BuildRequires: rpmbuild(macros) >= 1.710
55 Requires: python-modules >= 1:2.6
56 Obsoletes: python-distribute < 0.7
57 Obsoletes: python-setuptools-devel
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 setuptools is a collection of enhancements to the Python distutils
63 that allow you to more easily build and distribute Python 2.x
64 packages, especially ones that have dependencies on other packages.
66 %description -l pl.UTF-8
67 setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający
68 łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x,
69 szczególnie tych mających zależności od innych pakietów.
71 Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do
72 uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla
75 %package -n python3-%{module}
76 Summary: A collection of enhancements to the Python distutils
77 Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils
78 Group: Libraries/Python
79 Requires: python3-modules >= 1:3.2
80 Obsoletes: python3-distribute < 0.7
82 %description -n python3-%{module}
83 setuptools is a collection of enhancements to the Python distutils
84 that allow you to more easily build and distribute Python 3.x
85 packages, especially ones that have dependencies on other packages.
87 %description -n python3-%{module} -l pl.UTF-8
88 setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający
89 łatwiejsze budowanie i rozprowadzanie pakietów Pythona 3.x,
90 szczególnie tych mających zależności od innych pakietów.
92 %package -n easy_install
93 Summary: Python software installer
94 Summary(pl.UTF-8): Instalator oprogramowania napisanego w Pythonie
95 Group: Libraries/Python
96 %if %{with python3_default}
97 Requires: python3-%{module} = %{epoch}:%{version}-%{release}
99 Requires: python-%{module} = %{epoch}:%{version}-%{release}
101 Conflicts: python-setuptools < 1:18.6.1-2
103 %description -n easy_install
104 Python software installer.
106 %description -n easy_install -l pl.UTF-8
107 Instalator oprogramowania napisanego w Pythonie.
110 Summary: %{module} API documentation
111 Summary(pl.UTF-8): Dokumentacja API %{module}
115 API documentation for %{module}.
117 %description apidocs -l pl.UTF-8
118 Dokumentacja API %{module}.
121 %setup -q -n %{module}-%{version}
126 %py_build %{?with_tests:test}
131 %py3_build %{?with_tests:test}
135 #%{__make} -C docs html SPHINXBUILD=sphinx-build-3
136 # rst.linker needs sphinx-build to be run from directory containing "CHANGES.txt"
137 sphinx-build-3 -b html -d build/doctrees -D latex_paper_size=a4 docs build/html
141 rm -rf $RPM_BUILD_ROOT
150 # note: setuptools/command/easy_install.py expects setuptools/site-patch.py to exist
151 %py_postclean -x site-patch.py
154 %if %{with python3_default}
155 ln -sf easy_install-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
157 ln -sf easy_install-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install
161 rm -rf $RPM_BUILD_ROOT
165 %defattr(644,root,root,755)
166 %doc CHANGES.txt README.txt
167 %attr(755,root,root) %{_bindir}/easy_install-%{py_ver}
168 %{py_sitescriptdir}/pkg_resources
169 %{py_sitescriptdir}/setuptools
170 %{py_sitescriptdir}/easy_install.py[co]
171 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
175 %files -n python3-%{module}
176 %defattr(644,root,root,755)
177 %doc CHANGES.txt README.txt
178 %attr(755,root,root) %{_bindir}/easy_install-%{py3_ver}
179 %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co]
180 %{py3_sitescriptdir}/pkg_resources
181 %{py3_sitescriptdir}/setuptools
182 %{py3_sitescriptdir}/easy_install.py
183 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
186 %files -n easy_install
187 %defattr(644,root,root,755)
188 %attr(755,root,root) %{_bindir}/easy_install
192 %defattr(644,root,root,755)