]> git.pld-linux.org Git - packages/python-celery.git/blob - python-celery.spec
e1f678f648bcc63195dfbc45fc3668b6dafb5e3d
[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_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
18 %define         module  celery
19 Summary:        Celery - Distributed Task Query
20 Name:           python-%{module}
21 Version:        3.1.19
22 Release:        3
23 License:        BSD-like
24 Group:          Development/Languages/Python
25 Source0:        http://pypi.python.org/packages/source/c/%{module}/%{module}-%{version}.tar.gz
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
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
53 %endif
54 %endif
55 %if %{with python3}
56 BuildRequires:  python3-setuptools
57 %if %{with tests}
58 BuildRequires:  python3-nose
59 %endif
60 %endif
61 Requires:       python-billiard >= 3.3.0.21
62 Requires:       python-kombu >= 3.0.29
63 Requires:       python-pytz
64 BuildArch:      noarch
65 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67 %description
68 Celery is an asynchronous task queue/job queue based on distributed
69 message passing. It is focused on real-time operation, but supports
70 scheduling as well.
71
72 %package -n python3-%{module}
73 Summary:        Celery - Distributed Task Query
74 Group:          Development/Languages/Python
75 Requires:       python3-billiard >= 3.3.0.21
76 Requires:       python3-billiard < 3.4
77 Requires:       python3-kombu >= 3.0.29
78 Requires:       python3-kombu < 3.1
79 Requires:       python3-pytz
80
81 %description -n python3-%{module}
82 Celery is an asynchronous task queue/job queue based on distributed
83 message passing. It is focused on real-time operation, but supports
84 scheduling as well.
85
86 %package -n celery
87 Summary:        Celery - Distributed Task Query
88 Group:          Development/Languages/Python
89 %if %{with python3_default}
90 Requires:       python3-%{module} = %{version}
91 %else
92 Requires:       python-%{module} = %{version}
93 %endif
94
95 %description -n celery
96 Celery is an asynchronous task queue/job queue based on distributed
97 message passing. It is focused on real-time operation, but supports
98 scheduling as well.
99
100 %package apidocs
101 Summary:        %{module} API documentation
102 Summary(pl.UTF-8):      Dokumentacja API %{module}
103 Group:          Documentation
104
105 %description apidocs
106 API documentation for %{module}.
107
108 %description apidocs -l pl.UTF-8
109 Dokumentacja API %{module}.
110
111 %prep
112 %setup -q -n %{module}-%{version}
113
114 %patch0 -p1
115 %patch1 -p1
116 %patch2 -p1
117
118 cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} docs
119
120 %build
121 %if %{with python2}
122 %py_build %{?with_tests:test}
123
124 %if %{with doc}
125 cd docs
126 PYTHONPATH=../build-2/lib %{__make} -j1 html
127 rm -rf .build/html/_sources
128 cd ..
129 %endif
130 %endif
131 %if %{with python3}
132 %py3_build %{?with_tests:test}
133 %endif
134
135 %install
136 rm -rf $RPM_BUILD_ROOT
137
138 install_python2() {
139         %py_install
140
141         %py_postclean
142 }
143 install_python3() {
144         %py3_install
145 }
146
147 # install the right executables last
148 %if %{with python3} && %{without python3_default}
149 install_python3
150 %endif
151 %if %{with python2}
152 install_python2
153 %endif
154 %if %{with python3} && %{with python3_default}
155 install_python3
156 %endif
157
158 %if %{with python2}
159 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
160 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
161 find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \
162         | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
163 %endif
164 %if %{with python3}
165 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
166 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
167 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
168         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
169 %endif
170
171 %clean
172 rm -rf $RPM_BUILD_ROOT
173
174 %files
175 %defattr(644,root,root,755)
176 %doc CONTRIBUTORS.txt Changelog LICENSE README.rst TODO extra
177 %{py_sitescriptdir}/%{module}
178 %{py_sitescriptdir}/celery-*.egg-info
179 %{_examplesdir}/%{name}-%{version}
180
181 %files -n python3-%{module}
182 %defattr(644,root,root,755)
183 %doc CONTRIBUTORS.txt Changelog LICENSE README.rst TODO extra
184 %{py3_sitescriptdir}/%{module}
185 %{py3_sitescriptdir}/celery-*.egg-info
186 %{_examplesdir}/python3-%{module}-%{version}
187
188 %files -n celery
189 %attr(755,root,root) %{_bindir}/*
190
191 %if %{with doc}
192 %files apidocs
193 %defattr(644,root,root,755)
194 %doc docs/.build/html/*
195 %endif
This page took 0.081834 seconds and 2 git commands to generate.