]>
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: | |
d056e0ab | 8 | %bcond_with doc # do build doc (too much dependencies to be worth the trouble) |
d9473a22 JK |
9 | %bcond_with tests # run tests (broken) |
10 | %bcond_without python2 # CPython 2.x module | |
542c9da4 AM |
11 | %bcond_with python3 # CPython 3.x module |
12 | %bcond_with python3_default # Use Python 3.x for celery executables | |
d9473a22 JK |
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} |
542c9da4 | 21 | # keep python 2 version 4.x here; python3 in python3-celery.spec |
1abff933 | 22 | Version: 4.4.0 |
542c9da4 | 23 | Release: 3 |
a9916a02 | 24 | License: BSD-like |
25 | Group: Development/Languages/Python | |
1abff933 AM |
26 | # Source0: https://files.pythonhosted.org/packages/source/c/%{module}/%{module}-%{version}.tar.gz |
27 | Source0: https://pypi.debian.net/%{module}/%{module}-%{version}.tar.gz | |
28 | # Source0-md5: 9c5d17291bf204662ecc972eec26789e | |
d9473a22 JK |
29 | Source1: amqp-objects.inv |
30 | Source2: cyme-objects.inv | |
31 | Source3: djcelery-objects.inv | |
32 | Source4: kombu-objects.inv | |
33 | Source5: python-objects.inv | |
34 | Patch0: pytz_dependency.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 | 68 | %endif |
d056e0ab JK |
69 | Requires: python-billiard >= 3.5.0.2 |
70 | Requires: python-kombu >= 4.2.0 | |
d9473a22 | 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 | |
d056e0ab JK |
83 | Requires: python3-billiard >= 3.5.0.2 |
84 | Requires: python3-billiard < 4.0 | |
85 | Requires: python3-kombu >= 4.2.0 | |
86 | Requires: python3-kombu < 5.0 | |
d9473a22 JK |
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 | 133 | %patch0 -p1 |
a9916a02 | 134 | |
d9473a22 | 135 | cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} docs |
a9916a02 | 136 | |
d9473a22 JK |
137 | %build |
138 | %if %{with python2} | |
ac69e4fe | 139 | %py_build %{?with_tests:test} |
3ac9e124 | 140 | |
d9473a22 JK |
141 | %if %{with doc} |
142 | cd docs | |
f0ca0a00 | 143 | PYTHONPATH=../build-2/lib %{__make} -j1 html SPHINXBUILD=sphinx-build-2 |
d9473a22 | 144 | rm -rf .build/html/_sources |
f0ca0a00 | 145 | mv .build .build2 |
d9473a22 JK |
146 | cd .. |
147 | %endif | |
148 | %endif | |
149 | %if %{with python3} | |
ac69e4fe | 150 | %py3_build %{?with_tests:test} |
f0ca0a00 JK |
151 | |
152 | %if %{with doc} && 0 | |
153 | cd docs | |
154 | PYTHONPATH=../build-3/lib %{__make} -j1 html SPHINXBUILD=sphinx-build-3 | |
155 | rm -rf .build/html/_sources | |
156 | mv .build .build3 | |
157 | cd .. | |
158 | %endif | |
d9473a22 | 159 | %endif |
a9916a02 | 160 | |
d9473a22 | 161 | %install |
a9916a02 | 162 | rm -rf $RPM_BUILD_ROOT |
163 | ||
d9473a22 | 164 | install_python2() { |
ac69e4fe | 165 | %py_install |
3ac9e124 | 166 | |
d9473a22 JK |
167 | %py_postclean |
168 | } | |
169 | install_python3() { | |
ac69e4fe | 170 | %py3_install |
d9473a22 | 171 | } |
2bb3228d | 172 | |
d9473a22 JK |
173 | # install the right executables last |
174 | %if %{with python3} && %{without python3_default} | |
175 | install_python3 | |
176 | %endif | |
177 | %if %{with python2} | |
178 | install_python2 | |
179 | %endif | |
180 | %if %{with python3} && %{with python3_default} | |
181 | install_python3 | |
182 | %endif | |
3ac9e124 | 183 | |
d9473a22 JK |
184 | %if %{with python2} |
185 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
186 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
187 | find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \ | |
188 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
189 | %endif | |
190 | %if %{with python3} | |
191 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
192 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
193 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
194 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
195 | %endif | |
196 | ||
197 | %clean | |
198 | rm -rf $RPM_BUILD_ROOT | |
3ac9e124 | 199 | |
f0ca0a00 | 200 | %if %{with python2} |
a9916a02 | 201 | %files |
202 | %defattr(644,root,root,755) | |
1abff933 | 203 | %doc CONTRIBUTORS.txt LICENSE README.rst TODO extra |
ef667580 | 204 | %{py_sitescriptdir}/%{module} |
ef667580 | 205 | %{py_sitescriptdir}/celery-*.egg-info |
ef667580 | 206 | %{_examplesdir}/%{name}-%{version} |
d9473a22 | 207 | |
f0ca0a00 JK |
208 | %if %{with doc} |
209 | %files apidocs | |
210 | %defattr(644,root,root,755) | |
211 | %doc docs/.build2/html/* | |
212 | %endif | |
213 | %endif | |
214 | ||
215 | %if %{with python3} | |
d9473a22 JK |
216 | %files -n python3-%{module} |
217 | %defattr(644,root,root,755) | |
1abff933 | 218 | %doc CONTRIBUTORS.txt LICENSE README.rst TODO extra |
d9473a22 JK |
219 | %{py3_sitescriptdir}/%{module} |
220 | %{py3_sitescriptdir}/celery-*.egg-info | |
221 | %{_examplesdir}/python3-%{module}-%{version} | |
222 | ||
f0ca0a00 JK |
223 | %if %{with doc} && 0 |
224 | %files -n python3-%{module}-apidocs | |
d9473a22 | 225 | %defattr(644,root,root,755) |
f0ca0a00 | 226 | %doc docs/.build3/html/* |
d9473a22 | 227 | %endif |
f0ca0a00 JK |
228 | %endif |
229 | ||
230 | %files -n celery | |
231 | %attr(755,root,root) %{_bindir}/* |