]>
Commit | Line | Data |
---|---|---|
2f649423 MK |
1 | # |
2 | # Conditional build: | |
e2cd79ed JB |
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 | |
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 |
b79e62bc | 14 | Summary: A collection of enhancements to the Python distutils |
e4a6c4e2 | 15 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils |
b79e62bc | 16 | Name: python-setuptools |
e2cd79ed | 17 | Version: 20.2.2 |
dfd639a7 | 18 | Release: 1 |
67093d8e | 19 | Epoch: 1 |
2f649423 | 20 | License: PSF or ZPL |
b79e62bc | 21 | Group: Development/Languages/Python |
e2cd79ed | 22 | #Source0Download: https://pypi.python.org/simple/setuptools/ |
15009e3d | 23 | Source0: https://pypi.python.org/packages/source/s/setuptools/setuptools-%{version}.tar.gz |
e2cd79ed | 24 | # Source0-md5: bf37191cb4c1472fb61e6f933d2006b1 |
2f649423 | 25 | URL: https://bitbucket.org/pypa/setuptools |
c034c756 JB |
26 | %if %(locale -a | grep -q '^en_US.UTF-8$'; echo $?) |
27 | BuildRequires: glibc-localedb-all | |
28 | %endif | |
2f649423 | 29 | %if %{with python2} |
c034c756 | 30 | BuildRequires: python-modules >= 1:2.6 |
b6cbc91d | 31 | BuildConflicts: python-distribute < 0.7 |
e2cd79ed JB |
32 | %if %{with tests} |
33 | BuildRequires: python-mock | |
34 | BuildRequires: python-pytest >= 2.8 | |
35 | BuildRequires: python-pytest-runner | |
36 | %endif | |
2f649423 MK |
37 | %endif |
38 | %if %{with python3} | |
c034c756 | 39 | BuildRequires: python3-modules >= 1:3.2 |
b6cbc91d | 40 | BuildConflicts: python3-distribute < 0.7 |
e2cd79ed JB |
41 | %if %{with tests} |
42 | %if "%{py3_ver}" < "3.3" | |
43 | BuildRequires: python3-mock | |
44 | %endif | |
45 | BuildRequires: python3-pytest >= 2.8 | |
46 | BuildRequires: python3-pytest-runner | |
47 | %endif | |
2f649423 | 48 | %endif |
5c02125b | 49 | %if %{with apidocs} |
e2cd79ed | 50 | BuildRequires: python3-rst.linker >= 1.4 |
96995d3d | 51 | BuildRequires: sphinx-pdg-3 |
5c02125b | 52 | %endif |
c034c756 | 53 | BuildRequires: rpm-pythonprov |
b6cbc91d | 54 | BuildRequires: rpmbuild(macros) >= 1.710 |
c034c756 | 55 | Requires: python-modules >= 1:2.6 |
64c5aa5e | 56 | Obsoletes: python-distribute < 0.7 |
c034c756 | 57 | Obsoletes: python-setuptools-devel |
b79e62bc AM |
58 | BuildArch: noarch |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
60 | ||
61 | %description | |
62 | setuptools is a collection of enhancements to the Python distutils | |
c034c756 JB |
63 | that allow you to more easily build and distribute Python 2.x |
64 | packages, especially ones that have dependencies on other packages. | |
b79e62bc | 65 | |
1c17442b | 66 | %description -l pl.UTF-8 |
d539774b | 67 | setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający |
c034c756 JB |
68 | łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x, |
69 | szczególnie tych mających zależności od innych pakietów. | |
d539774b JB |
70 | |
71 | Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do | |
c034c756 JB |
72 | uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla |
73 | Pythona 2.x. | |
eadb908c | 74 | |
2f649423 | 75 | %package -n python3-%{module} |
c034c756 JB |
76 | Summary: A collection of enhancements to the Python distutils |
77 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils | |
2f649423 | 78 | Group: Libraries/Python |
c034c756 | 79 | Requires: python3-modules >= 1:3.2 |
ff466203 | 80 | Obsoletes: python3-distribute < 0.7 |
2f649423 MK |
81 | |
82 | %description -n python3-%{module} | |
c034c756 JB |
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. | |
2f649423 MK |
86 | |
87 | %description -n python3-%{module} -l pl.UTF-8 | |
c034c756 JB |
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. | |
2f649423 | 91 | |
25fb9ea9 JK |
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} | |
98 | %else | |
99 | Requires: python-%{module} = %{epoch}:%{version}-%{release} | |
100 | %endif | |
b6cbc91d | 101 | Conflicts: python-setuptools < 1:18.6.1-2 |
25fb9ea9 JK |
102 | |
103 | %description -n easy_install | |
104 | Python software installer. | |
105 | ||
106 | %description -n easy_install | |
107 | Instalator oprogramowania napisanego w Pythonie. | |
108 | ||
2f649423 MK |
109 | %package apidocs |
110 | Summary: %{module} API documentation | |
111 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
112 | Group: Documentation | |
113 | ||
114 | %description apidocs | |
115 | API documentation for %{module}. | |
116 | ||
117 | %description apidocs -l pl.UTF-8 | |
118 | Dokumentacja API %{module}. | |
119 | ||
b79e62bc | 120 | %prep |
2f649423 | 121 | %setup -q -n %{module}-%{version} |
b79e62bc AM |
122 | |
123 | %build | |
2f649423 | 124 | %if %{with python2} |
c034c756 | 125 | LC_ALL=en_US.UTF-8 \ |
a21b5be7 | 126 | %py_build %{?with_tests:test} |
2f649423 MK |
127 | %endif |
128 | ||
129 | %if %{with python3} | |
c034c756 | 130 | LC_ALL=en_US.UTF-8 \ |
a21b5be7 | 131 | %py3_build %{?with_tests:test} |
2f649423 | 132 | %endif |
b79e62bc | 133 | |
c034c756 | 134 | %if %{with apidocs} |
e2cd79ed | 135 | #%{__make} -C docs html SPHINXBUILD=sphinx-build-3 |
5c02125b | 136 | # rst.linker needs sphinx-build to be run from directory containing "CHANGES.txt" |
96995d3d | 137 | sphinx-build-3 -b html -d build/doctrees -D latex_paper_size=a4 docs build/html |
c034c756 JB |
138 | %endif |
139 | ||
b79e62bc AM |
140 | %install |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
c034c756 | 143 | %if %{with python3} |
a21b5be7 | 144 | %py3_install |
2f649423 | 145 | %endif |
991fba2b | 146 | |
c034c756 | 147 | %if %{with python2} |
a21b5be7 | 148 | %py_install |
c034c756 JB |
149 | |
150 | %py_postclean | |
2f649423 | 151 | %endif |
b79e62bc | 152 | |
25fb9ea9 | 153 | %if %{with python3_default} |
b6cbc91d | 154 | ln -sf easy_install-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install |
25fb9ea9 | 155 | %else |
b6cbc91d | 156 | ln -sf easy_install-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/easy_install |
25fb9ea9 JK |
157 | %endif |
158 | ||
b79e62bc AM |
159 | %clean |
160 | rm -rf $RPM_BUILD_ROOT | |
161 | ||
2f649423 | 162 | %if %{with python2} |
b79e62bc AM |
163 | %files |
164 | %defattr(644,root,root,755) | |
e2cd79ed | 165 | %doc CHANGES.txt README.txt |
25fb9ea9 | 166 | %attr(755,root,root) %{_bindir}/easy_install-%{py_ver} |
5c02125b JB |
167 | %{py_sitescriptdir}/pkg_resources |
168 | %{py_sitescriptdir}/setuptools | |
2f649423 | 169 | %{py_sitescriptdir}/easy_install.py[co] |
2f649423 MK |
170 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
171 | %endif | |
2f649423 MK |
172 | |
173 | %if %{with python3} | |
174 | %files -n python3-%{module} | |
f4841952 | 175 | %defattr(644,root,root,755) |
e2cd79ed | 176 | %doc CHANGES.txt README.txt |
25fb9ea9 | 177 | %attr(755,root,root) %{_bindir}/easy_install-%{py3_ver} |
c034c756 | 178 | %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co] |
5c02125b JB |
179 | %{py3_sitescriptdir}/pkg_resources |
180 | %{py3_sitescriptdir}/setuptools | |
2f649423 | 181 | %{py3_sitescriptdir}/easy_install.py |
2f649423 MK |
182 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
183 | %endif | |
184 | ||
25fb9ea9 JK |
185 | %files -n easy_install |
186 | %defattr(644,root,root,755) | |
187 | %attr(755,root,root) %{_bindir}/easy_install | |
188 | ||
c034c756 | 189 | %if %{with apidocs} |
2f649423 MK |
190 | %files apidocs |
191 | %defattr(644,root,root,755) | |
5c02125b | 192 | %doc build/html/* |
2f649423 | 193 | %endif |