]> git.pld-linux.org Git - packages/python-celery.git/blob - python-celery.spec
- rel 3; disable python3 - it is in python3-celery.spec now
[packages/python-celery.git] / python-celery.spec
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_with     doc             # do build doc (too much dependencies to be worth the trouble)
9 %bcond_with     tests           # run tests (broken)
10 %bcond_without  python2         # CPython 2.x module
11 %bcond_with     python3         # CPython 3.x module
12 %bcond_with     python3_default # Use Python 3.x for celery executables
13
14 %if %{without python3}
15 %undefine       python3_default
16 %endif
17
18 %define         module  celery
19 Summary:        Celery - Distributed Task Query
20 Name:           python-%{module}
21 # keep python 2 version 4.x here; python3 in python3-celery.spec
22 Version:        4.4.0
23 Release:        3
24 License:        BSD-like
25 Group:          Development/Languages/Python
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
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
35 URL:            http://celeryproject.org/
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  rpmbuild(macros) >= 1.710
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
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
52 BuildRequires:  sphinx-pdg-2
53 %endif
54 %endif
55 %if %{with python3}
56 BuildRequires:  python3-setuptools
57 %if %{with tests}
58 BuildRequires:  python3-nose
59 %endif
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
68 %endif
69 Requires:       python-billiard >= 3.5.0.2
70 Requires:       python-kombu >= 4.2.0
71 Requires:       python-pytz
72 BuildArch:      noarch
73 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74
75 %description
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.
79
80 %package -n python3-%{module}
81 Summary:        Celery - Distributed Task Query
82 Group:          Development/Languages/Python
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
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
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
130 %prep
131 %setup -q -n %{module}-%{version}
132
133 %patch0 -p1
134
135 cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} docs
136
137 %build
138 %if %{with python2}
139 %py_build %{?with_tests:test}
140
141 %if %{with doc}
142 cd docs
143 PYTHONPATH=../build-2/lib %{__make} -j1 html SPHINXBUILD=sphinx-build-2
144 rm -rf .build/html/_sources
145 mv .build .build2
146 cd ..
147 %endif
148 %endif
149 %if %{with python3}
150 %py3_build %{?with_tests:test}
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
159 %endif
160
161 %install
162 rm -rf $RPM_BUILD_ROOT
163
164 install_python2() {
165         %py_install
166
167         %py_postclean
168 }
169 install_python3() {
170         %py3_install
171 }
172
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
183
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
199
200 %if %{with python2}
201 %files
202 %defattr(644,root,root,755)
203 %doc CONTRIBUTORS.txt LICENSE README.rst TODO extra
204 %{py_sitescriptdir}/%{module}
205 %{py_sitescriptdir}/celery-*.egg-info
206 %{_examplesdir}/%{name}-%{version}
207
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}
216 %files -n python3-%{module}
217 %defattr(644,root,root,755)
218 %doc CONTRIBUTORS.txt LICENSE README.rst TODO extra
219 %{py3_sitescriptdir}/%{module}
220 %{py3_sitescriptdir}/celery-*.egg-info
221 %{_examplesdir}/python3-%{module}-%{version}
222
223 %if %{with doc} && 0
224 %files -n python3-%{module}-apidocs
225 %defattr(644,root,root,755)
226 %doc docs/.build3/html/*
227 %endif
228 %endif
229
230 %files -n celery
231 %attr(755,root,root) %{_bindir}/*
This page took 0.094761 seconds and 3 git commands to generate.