]>
Commit | Line | Data |
---|---|---|
2f649423 MK |
1 | # |
2 | # Conditional build: | |
c034c756 JB |
3 | %bcond_without apidocs # sphinx based documentation |
4 | %bcond_with tests # "test" action (fails?) | |
2f649423 MK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
cb552c1a | 8 | %define module setuptools |
b79e62bc | 9 | Summary: A collection of enhancements to the Python distutils |
e4a6c4e2 | 10 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils |
b79e62bc | 11 | Name: python-setuptools |
5c02125b JB |
12 | Version: 14.0 |
13 | Release: 1 | |
67093d8e | 14 | Epoch: 1 |
2f649423 | 15 | License: PSF or ZPL |
b79e62bc | 16 | Group: Development/Languages/Python |
5c02125b | 17 | #Source0Download: https://pypi.python.org/pypi/setuptools |
15009e3d | 18 | Source0: https://pypi.python.org/packages/source/s/setuptools/setuptools-%{version}.tar.gz |
5c02125b | 19 | # Source0-md5: 058655fe511deccb4359bf02727f5199 |
2f649423 | 20 | URL: https://bitbucket.org/pypa/setuptools |
c034c756 JB |
21 | %if %(locale -a | grep -q '^en_US.UTF-8$'; echo $?) |
22 | BuildRequires: glibc-localedb-all | |
23 | %endif | |
2f649423 MK |
24 | %if %{with python2} |
25 | BuildRequires: python-distribute | |
c034c756 | 26 | BuildRequires: python-modules >= 1:2.6 |
2f649423 MK |
27 | %endif |
28 | %if %{with python3} | |
29 | BuildRequires: python3-distribute | |
c034c756 | 30 | BuildRequires: python3-modules >= 1:3.2 |
2f649423 | 31 | %endif |
5c02125b JB |
32 | %if %{with apidocs} |
33 | BuildRequires: python-rst.linker | |
34 | BuildRequires: sphinx-pdg | |
35 | %endif | |
c034c756 JB |
36 | BuildRequires: rpm-pythonprov |
37 | Requires: python-modules >= 1:2.6 | |
b79ba3d0 | 38 | Obsoletes: python-distribute |
c034c756 | 39 | Obsoletes: python-setuptools-devel |
b79e62bc AM |
40 | BuildArch: noarch |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | setuptools is a collection of enhancements to the Python distutils | |
c034c756 JB |
45 | that allow you to more easily build and distribute Python 2.x |
46 | packages, especially ones that have dependencies on other packages. | |
b79e62bc | 47 | |
1c17442b | 48 | %description -l pl.UTF-8 |
d539774b | 49 | setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający |
c034c756 JB |
50 | łatwiejsze budowanie i rozprowadzanie pakietów Pythona 2.x, |
51 | szczególnie tych mających zależności od innych pakietów. | |
d539774b JB |
52 | |
53 | Ten pakiet zawiera składniki uruchomieniowe setuptools, potrzebne do | |
c034c756 JB |
54 | uruchamiania kodu wymagającego pkg_resources.py, przeznaczone dla |
55 | Pythona 2.x. | |
eadb908c | 56 | |
2f649423 | 57 | %package -n python3-%{module} |
c034c756 JB |
58 | Summary: A collection of enhancements to the Python distutils |
59 | Summary(pl.UTF-8): Zestaw rozszerzeń dla pythonowych distutils | |
2f649423 | 60 | Group: Libraries/Python |
c034c756 | 61 | Requires: python3-modules >= 1:3.2 |
2f649423 MK |
62 | |
63 | %description -n python3-%{module} | |
c034c756 JB |
64 | setuptools is a collection of enhancements to the Python distutils |
65 | that allow you to more easily build and distribute Python 3.x | |
66 | packages, especially ones that have dependencies on other packages. | |
2f649423 MK |
67 | |
68 | %description -n python3-%{module} -l pl.UTF-8 | |
c034c756 JB |
69 | setuptools to zestaw rozszerzeń do pythonowych distutils umożliwiający |
70 | łatwiejsze budowanie i rozprowadzanie pakietów Pythona 3.x, | |
71 | szczególnie tych mających zależności od innych pakietów. | |
2f649423 MK |
72 | |
73 | %package apidocs | |
74 | Summary: %{module} API documentation | |
75 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
76 | Group: Documentation | |
77 | ||
78 | %description apidocs | |
79 | API documentation for %{module}. | |
80 | ||
81 | %description apidocs -l pl.UTF-8 | |
82 | Dokumentacja API %{module}. | |
83 | ||
b79e62bc | 84 | %prep |
2f649423 | 85 | %setup -q -n %{module}-%{version} |
b79e62bc AM |
86 | |
87 | %build | |
2f649423 | 88 | %if %{with python2} |
c034c756 | 89 | LC_ALL=en_US.UTF-8 \ |
2f649423 MK |
90 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
c034c756 | 94 | LC_ALL=en_US.UTF-8 \ |
2f649423 MK |
95 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} |
96 | %endif | |
b79e62bc | 97 | |
c034c756 | 98 | %if %{with apidocs} |
5c02125b JB |
99 | #%{__make} -C docs html |
100 | # rst.linker needs sphinx-build to be run from directory containing "CHANGES.txt" | |
101 | sphinx-build -b html -d build/doctrees -D latex_paper_size=a4 docs build/html | |
c034c756 JB |
102 | %endif |
103 | ||
b79e62bc AM |
104 | %install |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
c034c756 JB |
107 | %if %{with python3} |
108 | %{__python3} setup.py \ | |
109 | build --build-base build-3 \ | |
2f649423 MK |
110 | install --skip-build \ |
111 | --optimize=2 \ | |
b79e62bc | 112 | --root=$RPM_BUILD_ROOT |
2f649423 | 113 | %endif |
991fba2b | 114 | |
c034c756 JB |
115 | %if %{with python2} |
116 | %{__python} setup.py \ | |
117 | build --build-base build-2 \ | |
2f649423 MK |
118 | install --skip-build \ |
119 | --optimize=2 \ | |
120 | --root=$RPM_BUILD_ROOT | |
c034c756 JB |
121 | |
122 | %py_postclean | |
2f649423 | 123 | %endif |
b79e62bc AM |
124 | |
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
2f649423 | 128 | %if %{with python2} |
b79e62bc AM |
129 | %files |
130 | %defattr(644,root,root,755) | |
b79ba3d0 | 131 | %doc CHANGES.txt README.txt DEVGUIDE.txt |
2f649423 MK |
132 | %attr(755,root,root) %{_bindir}/easy_install |
133 | %attr(755,root,root) %{_bindir}/easy_install-2.* | |
5c02125b JB |
134 | %{py_sitescriptdir}/pkg_resources |
135 | %{py_sitescriptdir}/setuptools | |
2f649423 MK |
136 | %{py_sitescriptdir}/_markerlib |
137 | %{py_sitescriptdir}/easy_install.py[co] | |
2f649423 MK |
138 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
139 | %endif | |
2f649423 MK |
140 | |
141 | %if %{with python3} | |
142 | %files -n python3-%{module} | |
f4841952 | 143 | %defattr(644,root,root,755) |
b79ba3d0 | 144 | %doc CHANGES.txt README.txt DEVGUIDE.txt |
2f649423 | 145 | %attr(755,root,root) %{_bindir}/easy_install-3.* |
c034c756 | 146 | %{py3_sitescriptdir}/__pycache__/easy_install.*.py[co] |
5c02125b JB |
147 | %{py3_sitescriptdir}/pkg_resources |
148 | %{py3_sitescriptdir}/setuptools | |
2f649423 MK |
149 | %{py3_sitescriptdir}/_markerlib |
150 | %{py3_sitescriptdir}/easy_install.py | |
2f649423 MK |
151 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
152 | %endif | |
153 | ||
c034c756 | 154 | %if %{with apidocs} |
2f649423 MK |
155 | %files apidocs |
156 | %defattr(644,root,root,755) | |
5c02125b | 157 | %doc build/html/* |
2f649423 | 158 | %endif |