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