]>
Commit | Line | Data |
---|---|---|
d9473a22 JK |
1 | |
2 | # TODO: | |
3 | # - consider init script / systemd job (uid/gid celery 274 used to be used) | |
4 | # NOTE: this must not be included and enabled by default in the default | |
5 | # package! Real-life deployments will mostly be application-specific. | |
6 | ||
7 | # Conditional build: | |
8 | %bcond_without doc # don't build doc | |
9 | %bcond_with tests # run tests (broken) | |
10 | %bcond_without python2 # CPython 2.x module | |
11 | %bcond_without python3 # CPython 3.x module | |
12 | %bcond_without python3_default # Use Python 3.x for celery executables | |
13 | ||
14 | %if %{without python3} | |
15 | %undefine python3_default | |
16 | %endif | |
17 | ||
a9916a02 | 18 | %define module celery |
d9473a22 | 19 | Summary: Celery - Distributed Task Query |
a9916a02 | 20 | Name: python-%{module} |
d9473a22 | 21 | Version: 3.1.19 |
f0ca0a00 | 22 | Release: 4 |
a9916a02 | 23 | License: BSD-like |
24 | Group: Development/Languages/Python | |
25 | Source0: http://pypi.python.org/packages/source/c/%{module}/%{module}-%{version}.tar.gz | |
d9473a22 JK |
26 | # Source0-md5: fba8c4b269814dc6dbc36abb0e66c384 |
27 | Source1: amqp-objects.inv | |
28 | Source2: cyme-objects.inv | |
29 | Source3: djcelery-objects.inv | |
30 | Source4: kombu-objects.inv | |
31 | Source5: python-objects.inv | |
32 | Patch0: pytz_dependency.patch | |
33 | Patch1: unittest2.patch | |
34 | Patch2: intersphinx.patch | |
2332a36a | 35 | URL: http://celeryproject.org/ |
a9916a02 | 36 | BuildRequires: rpm-pythonprov |
61ec3e45 | 37 | BuildRequires: rpmbuild(macros) >= 1.710 |
d9473a22 JK |
38 | BuildRequires: sed >= 4.0 |
39 | %if %{with python2} | |
40 | BuildRequires: python-setuptools | |
41 | %if %{with tests} | |
42 | BuildRequires: python-mock >= 1.0.1 | |
43 | BuildRequires: python-modules >= 1:2.7 | |
44 | BuildRequires: python-nose | |
45 | %endif | |
28f8a25a JK |
46 | %if %{with doc} |
47 | BuildRequires: python-billiard | |
48 | BuildRequires: python-django | |
49 | BuildRequires: python-kombu | |
50 | BuildRequires: python-pytz | |
51 | BuildRequires: python-sphinxcontrib-issuetracker | |
f0ca0a00 | 52 | BuildRequires: sphinx-pdg-2 |
28f8a25a | 53 | %endif |
d9473a22 JK |
54 | %endif |
55 | %if %{with python3} | |
56 | BuildRequires: python3-setuptools | |
57 | %if %{with tests} | |
58 | BuildRequires: python3-nose | |
59 | %endif | |
f0ca0a00 JK |
60 | %if %{with doc} |
61 | BuildRequires: python3-billiard | |
62 | BuildRequires: python3-django | |
63 | BuildRequires: python3-kombu | |
64 | BuildRequires: python3-pytz | |
65 | BuildRequires: python3-sphinxcontrib-issuetracker | |
66 | BuildRequires: sphinx-pdg-3 | |
67 | %endif | |
d9473a22 JK |
68 | %endif |
69 | Requires: python-billiard >= 3.3.0.21 | |
70 | Requires: python-kombu >= 3.0.29 | |
71 | Requires: python-pytz | |
ef667580 | 72 | BuildArch: noarch |
a9916a02 | 73 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
74 | ||
75 | %description | |
2332a36a | 76 | Celery is an asynchronous task queue/job queue based on distributed |
77 | message passing. It is focused on real-time operation, but supports | |
78 | scheduling as well. | |
a9916a02 | 79 | |
d9473a22 JK |
80 | %package -n python3-%{module} |
81 | Summary: Celery - Distributed Task Query | |
82 | Group: Development/Languages/Python | |
83 | Requires: python3-billiard >= 3.3.0.21 | |
84 | Requires: python3-billiard < 3.4 | |
85 | Requires: python3-kombu >= 3.0.29 | |
86 | Requires: python3-kombu < 3.1 | |
87 | Requires: python3-pytz | |
88 | ||
89 | %description -n python3-%{module} | |
90 | Celery is an asynchronous task queue/job queue based on distributed | |
91 | message passing. It is focused on real-time operation, but supports | |
92 | scheduling as well. | |
93 | ||
94 | %package -n celery | |
95 | Summary: Celery - Distributed Task Query | |
96 | Group: Development/Languages/Python | |
97 | %if %{with python3_default} | |
98 | Requires: python3-%{module} = %{version} | |
99 | %else | |
100 | Requires: python-%{module} = %{version} | |
101 | %endif | |
102 | ||
103 | %description -n celery | |
104 | Celery is an asynchronous task queue/job queue based on distributed | |
105 | message passing. It is focused on real-time operation, but supports | |
106 | scheduling as well. | |
107 | ||
108 | %package apidocs | |
109 | Summary: %{module} API documentation | |
110 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
111 | Group: Documentation | |
112 | ||
113 | %description apidocs | |
114 | API documentation for %{module}. | |
115 | ||
116 | %description apidocs -l pl.UTF-8 | |
117 | Dokumentacja API %{module}. | |
118 | ||
f0ca0a00 JK |
119 | %package -n python3-%{module}-apidocs |
120 | Summary: %{module} API documentation | |
121 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
122 | Group: Documentation | |
123 | ||
124 | %description -n python3-%{module}-apidocs | |
125 | API documentation for %{module}. | |
126 | ||
127 | %description -n python3-%{module}-apidocs -l pl.UTF-8 | |
128 | Dokumentacja API %{module}. | |
129 | ||
a9916a02 | 130 | %prep |
131 | %setup -q -n %{module}-%{version} | |
132 | ||
d9473a22 JK |
133 | %patch0 -p1 |
134 | %patch1 -p1 | |
135 | %patch2 -p1 | |
a9916a02 | 136 | |
d9473a22 | 137 | cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} docs |
a9916a02 | 138 | |
d9473a22 JK |
139 | %build |
140 | %if %{with python2} | |
ac69e4fe | 141 | %py_build %{?with_tests:test} |
3ac9e124 | 142 | |
d9473a22 JK |
143 | %if %{with doc} |
144 | cd docs | |
f0ca0a00 | 145 | PYTHONPATH=../build-2/lib %{__make} -j1 html SPHINXBUILD=sphinx-build-2 |
d9473a22 | 146 | rm -rf .build/html/_sources |
f0ca0a00 | 147 | mv .build .build2 |
d9473a22 JK |
148 | cd .. |
149 | %endif | |
150 | %endif | |
151 | %if %{with python3} | |
ac69e4fe | 152 | %py3_build %{?with_tests:test} |
f0ca0a00 JK |
153 | |
154 | %if %{with doc} && 0 | |
155 | cd docs | |
156 | PYTHONPATH=../build-3/lib %{__make} -j1 html SPHINXBUILD=sphinx-build-3 | |
157 | rm -rf .build/html/_sources | |
158 | mv .build .build3 | |
159 | cd .. | |
160 | %endif | |
d9473a22 | 161 | %endif |
a9916a02 | 162 | |
d9473a22 | 163 | %install |
a9916a02 | 164 | rm -rf $RPM_BUILD_ROOT |
165 | ||
d9473a22 | 166 | install_python2() { |
ac69e4fe | 167 | %py_install |
3ac9e124 | 168 | |
d9473a22 JK |
169 | %py_postclean |
170 | } | |
171 | install_python3() { | |
ac69e4fe | 172 | %py3_install |
d9473a22 | 173 | } |
2bb3228d | 174 | |
d9473a22 JK |
175 | # install the right executables last |
176 | %if %{with python3} && %{without python3_default} | |
177 | install_python3 | |
178 | %endif | |
179 | %if %{with python2} | |
180 | install_python2 | |
181 | %endif | |
182 | %if %{with python3} && %{with python3_default} | |
183 | install_python3 | |
184 | %endif | |
3ac9e124 | 185 | |
d9473a22 JK |
186 | %if %{with python2} |
187 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
188 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
189 | find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \ | |
190 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
191 | %endif | |
192 | %if %{with python3} | |
193 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
194 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
195 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
196 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
197 | %endif | |
198 | ||
199 | %clean | |
200 | rm -rf $RPM_BUILD_ROOT | |
3ac9e124 | 201 | |
f0ca0a00 | 202 | %if %{with python2} |
a9916a02 | 203 | %files |
204 | %defattr(644,root,root,755) | |
d9473a22 | 205 | %doc CONTRIBUTORS.txt Changelog LICENSE README.rst TODO extra |
ef667580 | 206 | %{py_sitescriptdir}/%{module} |
ef667580 | 207 | %{py_sitescriptdir}/celery-*.egg-info |
ef667580 | 208 | %{_examplesdir}/%{name}-%{version} |
d9473a22 | 209 | |
f0ca0a00 JK |
210 | %if %{with doc} |
211 | %files apidocs | |
212 | %defattr(644,root,root,755) | |
213 | %doc docs/.build2/html/* | |
214 | %endif | |
215 | %endif | |
216 | ||
217 | %if %{with python3} | |
d9473a22 JK |
218 | %files -n python3-%{module} |
219 | %defattr(644,root,root,755) | |
220 | %doc CONTRIBUTORS.txt Changelog LICENSE README.rst TODO extra | |
221 | %{py3_sitescriptdir}/%{module} | |
222 | %{py3_sitescriptdir}/celery-*.egg-info | |
223 | %{_examplesdir}/python3-%{module}-%{version} | |
224 | ||
f0ca0a00 JK |
225 | %if %{with doc} && 0 |
226 | %files -n python3-%{module}-apidocs | |
d9473a22 | 227 | %defattr(644,root,root,755) |
f0ca0a00 | 228 | %doc docs/.build3/html/* |
d9473a22 | 229 | %endif |
f0ca0a00 JK |
230 | %endif |
231 | ||
232 | %files -n celery | |
233 | %attr(755,root,root) %{_bindir}/* |