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