Add python-pecan dependency to ceilometr-python and compute
[openstack-build/ceilometer-build.git] / rpm / SPECS / openstack-ceilometer.spec
1 %global _without_doc 1
2 %global with_doc %{!?_without_doc:1}%{?_without_doc:0}
3 %global pypi_name ceilometer
4
5 Name:             openstack-ceilometer
6 Version:          2014.1
7 Release:          0.6.rc1%{?dist}
8 Summary:          OpenStack measurement collection service
9
10 Group:            Applications/System
11 License:          ASL 2.0
12 URL:              https://wiki.openstack.org/wiki/Ceilometer
13 Source0:          http://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.rc1.tar.gz
14 Source1:          %{pypi_name}-dist.conf
15 Source2:          %{pypi_name}.logrotate
16
17 Source10:         %{name}-api.init
18 Source100:        %{name}-api.upstart
19 Source11:         %{name}-collector.init
20 Source110:        %{name}-collector.upstart
21 Source12:         %{name}-compute.init
22 Source120:        %{name}-compute.upstart
23 Source13:         %{name}-central.init
24 Source130:        %{name}-central.upstart
25 Source14:         %{name}-alarm-notifier.init
26 Source140:        %{name}-alarm-notifier.upstart
27 Source15:         %{name}-alarm-evaluator.init
28 Source150:        %{name}-alarm-evaluator.upstart
29 Source16:         %{name}-notification.init
30 Source160:        %{name}-notification.upstart
31
32 #
33 # patches_base=2014.1.rc1
34 #
35 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
36
37 # This is EL6 specific and not upstream
38 Patch100:         openstack-ceilometer-newdeps.patch
39
40 BuildArch:        noarch
41 BuildRequires:    intltool
42 BuildRequires:    python-sphinx10
43 BuildRequires:    python-setuptools
44 BuildRequires:    python-pbr
45 BuildRequires:    python-d2to1
46 BuildRequires:    python2-devel
47
48 BuildRequires:    openstack-utils
49
50 # These are required to build due to the requirements check added
51 BuildRequires:    python-sqlalchemy0.7
52 BuildRequires:    python-webob1.2
53
54
55 %description
56 OpenStack ceilometer provides services to measure and
57 collect metrics from OpenStack components.
58
59
60 %package -n       python-ceilometer
61 Summary:          OpenStack ceilometer python libraries
62 Group:            Applications/System
63
64 Requires:         python-qpid
65 Requires:         python-kombu
66 Requires:         python-amqplib
67
68 Requires:         python-babel
69 Requires:         python-eventlet
70 Requires:         python-greenlet
71 Requires:         python-iso8601
72 Requires:         python-lxml
73 Requires:         python-anyjson
74 Requires:         python-jsonpath-rw
75 Requires:         python-stevedore >= 0.14
76 Requires:         python-msgpack
77 Requires:         python-six >= 1.4.1
78 Requires:         PyYAML
79
80 Requires:         python-sqlalchemy0.7
81 Requires:         python-alembic
82 Requires:         python-migrate
83
84 Requires:         python-webob >= 1.2
85
86 Requires:         python-oslo-config >= 1:1.2.0
87
88 Requires:         pysnmp
89 Requires:         pytz
90 Requires:         python-croniter
91 Requires:         python-pecan
92
93 %description -n   python-ceilometer
94 OpenStack ceilometer provides services to measure and
95 collect metrics from OpenStack components.
96
97 This package contains the ceilometer python library.
98
99
100 %package common
101 Summary:          Components common to all OpenStack ceilometer services
102 Group:            Applications/System
103
104 Requires:         python-ceilometer = %{version}-%{release}
105 Requires:         openstack-utils
106
107 Requires(post):   chkconfig
108 Requires(postun): initscripts
109 Requires(preun):  chkconfig
110 Requires(pre):    shadow-utils
111
112
113
114 %description common
115 OpenStack ceilometer provides services to measure and
116 collect metrics from OpenStack components.
117
118 This package contains components common to all OpenStack
119 ceilometer services.
120
121
122 %package compute
123 Summary:          OpenStack ceilometer compute agent
124 Group:            Applications/System
125
126 Requires:         %{name}-common = %{version}-%{release}
127
128 Requires:         python-novaclient
129 Requires:         python-keystoneclient
130 Requires:         libvirt-python
131 Requires:         python-pecan
132
133 %description compute
134 OpenStack ceilometer provides services to measure and
135 collect metrics from OpenStack components.
136
137 This package contains the ceilometer agent for
138 running on OpenStack compute nodes.
139
140
141 %package central
142 Summary:          OpenStack ceilometer central agent
143 Group:            Applications/System
144
145 Requires:         %{name}-common = %{version}-%{release}
146
147 Requires:         python-novaclient
148 Requires:         python-keystoneclient
149 Requires:         python-glanceclient
150 Requires:         python-swiftclient
151
152 %description central
153 OpenStack ceilometer provides services to measure and
154 collect metrics from OpenStack components.
155
156 This package contains the central ceilometer agent.
157
158
159 %package collector
160 Summary:          OpenStack ceilometer collector agent
161 Group:            Applications/System
162
163 Requires:         %{name}-common = %{version}-%{release}
164
165 Requires:         python-pymongo
166
167 %description collector
168 OpenStack ceilometer provides services to measure and
169 collect metrics from OpenStack components.
170
171 This package contains the ceilometer collector agent.
172
173
174 %package api
175 Summary:          OpenStack ceilometer API service
176 Group:            Applications/System
177
178 Requires:         %{name}-common = %{version}-%{release}
179
180 Requires:         python-pymongo
181 Requires:         python-flask
182 Requires:         python-pecan >= 0.4.5
183 Requires:         python-wsme >= 0.6
184
185 %description api
186 OpenStack ceilometer provides services to measure and
187 collect metrics from OpenStack components.
188
189 This package contains the ceilometer API service.
190
191
192 %package alarm
193 Summary:          OpenStack ceilometer alarm services
194 Group:            Applications/System
195
196 Requires:         %{name}-common = %{version}-%{release}
197 Requires:         python-ceilometerclient
198
199 %description alarm
200 OpenStack ceilometer provides services to measure and
201 collect metrics from OpenStack components.
202
203 This package contains the ceilometer alarm notification
204 and evaluation services.
205
206
207 %if 0%{?with_doc}
208 %package doc
209 Summary:          Documentation for OpenStack ceilometer
210 Group:            Documentation
211
212 # Required to build module documents
213 BuildRequires:    python-eventlet
214 BuildRequires:    python-sqlalchemy0.7
215 BuildRequires:    python-webob
216 # while not strictly required, quiets the build down when building docs.
217 BuildRequires:    python-migrate, python-iso8601
218
219 %description      doc
220 OpenStack ceilometer provides services to measure and
221 collect metrics from OpenStack components.
222
223 This package contains documentation files for ceilometer.
224 %endif
225
226 %prep
227 %setup -q -n ceilometer-%{version}
228
229 %patch0001 -p1
230
231 # Apply EL6 patch
232 %patch100 -p1
233
234 find . \( -name .gitignore -o -name .placeholder \) -delete
235
236 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
237
238 # TODO: Have the following handle multi line entries
239 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
240
241 # Remove the requirements file so that pbr hooks don't add it
242 # to distutils requires_dist config
243 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
244
245 # Programmatically update defaults in sample config
246 # which is installed at /etc/ceilometer/ceilometer.conf
247 # TODO: Make this more robust
248 # Note it only edits the first occurance, so assumes a section ordering in sample
249 # and also doesn't support multi-valued variables.
250 while read name eq value; do
251   test "$name" && test "$value" || continue
252   sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
253 done < %{SOURCE1}
254
255 %build
256 %{__python} setup.py build
257
258 %install
259 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
260
261 # docs generation requires everything to be installed first
262 export PYTHONPATH="$( pwd ):$PYTHONPATH"
263
264 pushd doc
265
266 %if 0%{?with_doc}
267 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
268 # Fix hidden-file-or-dir warnings
269 rm -fr build/html/.doctrees build/html/.buildinfo
270 %endif
271
272 popd
273
274 # Setup directories
275 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
276 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
277 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
278
279 # Install config files
280 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
281 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
282 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
283 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
284 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
285 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
286
287 # Install initscripts for services
288 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
289 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
290 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
291 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
292 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
293 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
294 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
295
296 # Install upstart jobs examples
297 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
298 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
299 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
300 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
301 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
302 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
303 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
304 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
305
306 # Install logrotate
307 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
308
309 # Install pid directory
310 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
311
312 # Remove unneeded in production stuff
313 rm -f %{buildroot}%{_bindir}/ceilometer-debug
314 rm -fr %{buildroot}%{python_sitelib}/tests/
315 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
316 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
317 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
318
319
320 %pre common
321 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
322 if ! getent passwd ceilometer >/dev/null; then
323   # Id reservation request: https://bugzilla.redhat.com/923891
324   useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
325 fi
326 exit 0
327
328 %post compute
329 if [ $1 -eq 1 ] ; then
330     # Initial installation
331     /sbin/chkconfig --add %{name}-compute
332 fi
333
334 %post collector
335 if [ $1 -eq 1 ] ; then
336     # Initial installation
337     /sbin/chkconfig --add %{name}-collector
338 fi
339
340 %post api
341 if [ $1 -eq 1 ] ; then
342     # Initial installation
343     /sbin/chkconfig --add %{name}-api
344 fi
345
346 %post central
347 if [ $1 -eq 1 ] ; then
348     # Initial installation
349     /sbin/chkconfig --add %{name}-central
350 fi
351
352 %post alarm
353 if [ $1 -eq 1 ] ; then
354     # Initial installation
355     for svc in alarm-notifier alarm-evaluator; do
356         /sbin/chkconfig --add %{name}-${svc}
357     done
358 fi
359
360 %preun compute
361 if [ $1 -eq 0 ] ; then
362     for svc in compute; do
363         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
364         /sbin/chkconfig --del %{name}-${svc}
365     done
366 fi
367
368 %preun collector
369 if [ $1 -eq 0 ] ; then
370     for svc in collector notification; do
371         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
372         /sbin/chkconfig --del %{name}-${svc}
373     done
374 fi
375
376 %preun api
377 if [ $1 -eq 0 ] ; then
378     for svc in api; do
379         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
380         /sbin/chkconfig --del %{name}-${svc}
381     done
382 fi
383
384 %preun central
385 if [ $1 -eq 0 ] ; then
386     for svc in central; do
387         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
388         /sbin/chkconfig --del %{name}-${svc}
389     done
390 fi
391
392 %preun alarm
393 if [ $1 -eq 0 ] ; then
394     for svc in alarm-notifier alarm-evaluator; do
395         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
396         /sbin/chkconfig --del %{name}-${svc}
397     done
398 fi
399
400 %postun compute
401 if [ $1 -ge 1 ] ; then
402     # Package upgrade, not uninstall
403     for svc in compute; do
404         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
405     done
406 fi
407
408 %postun collector
409 if [ $1 -ge 1 ] ; then
410     # Package upgrade, not uninstall
411     for svc in collector notification; do
412         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
413     done
414 fi
415
416 %postun api
417 if [ $1 -ge 1 ] ; then
418     # Package upgrade, not uninstall
419     for svc in api; do
420         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
421     done
422 fi
423
424 %postun central
425 if [ $1 -ge 1 ] ; then
426     # Package upgrade, not uninstall
427     for svc in central; do
428         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
429     done
430 fi
431
432 %postun alarm
433 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
434 if [ $1 -ge 1 ] ; then
435     # Package upgrade, not uninstall
436     for svc in alarm-notifier alarm-evaluator; do
437         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
438     done
439 fi
440
441
442 %files common
443 %doc LICENSE
444 %dir %{_sysconfdir}/ceilometer
445 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
446 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
447 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
448 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
449 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
450 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
451
452 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
453 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
454
455 %{_bindir}/ceilometer-dbsync
456 %{_bindir}/ceilometer-expirer
457 %{_bindir}/ceilometer-send-sample
458
459
460 %defattr(-, ceilometer, ceilometer, -)
461 %dir %{_sharedstatedir}/ceilometer
462 %dir %{_sharedstatedir}/ceilometer/tmp
463
464
465 %files -n python-ceilometer
466 %{python_sitelib}/ceilometer
467 %{python_sitelib}/ceilometer-%{version}*.egg-info
468
469
470 %if 0%{?with_doc}
471 %files doc
472 %doc doc/build/html
473 %endif
474
475
476 %files compute
477 %{_bindir}/ceilometer-agent-compute
478 %{_initrddir}/%{name}-compute
479 %{_datarootdir}/ceilometer/%{name}-compute.upstart
480
481
482 %files collector
483 %{_bindir}/ceilometer-collector*
484 %{_bindir}/ceilometer-agent-notification
485 %{_initrddir}/%{name}-collector
486 %{_initrddir}/%{name}-notification
487 %{_datarootdir}/ceilometer/%{name}-collector.upstart
488 %{_datarootdir}/ceilometer/%{name}-notification.upstart
489
490
491 %files api
492 %doc ceilometer/api/v1/static/LICENSE.*
493 %{_bindir}/ceilometer-api
494 %{_initrddir}/%{name}-api
495 %{_datarootdir}/ceilometer/%{name}-api.upstart
496
497
498 %files central
499 %{_bindir}/ceilometer-agent-central
500 %{_initrddir}/%{name}-central
501 %{_datarootdir}/ceilometer/%{name}-central.upstart
502
503
504 %files alarm
505 %{_bindir}/ceilometer-alarm-notifier
506 %{_bindir}/ceilometer-alarm-evaluator
507 %{_initrddir}/%{name}-alarm-notifier
508 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
509 %{_initrddir}/%{name}-alarm-evaluator
510 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
511
512
513 %changelog
514 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
515 - Update to upstream 2014.1.rc1
516
517 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
518 - Update to Icehouse milestone 3
519
520 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
521 - Fix missing dependency on python-babel
522
523 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
524 - Update to Icehouse milestone 2
525
526 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
527 - Set python-six min version to ensure updated
528
529 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
530 - Update to Icehouse milestone 1
531
532 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
533 - Update to Havana stable release 2013.2.1
534
535 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
536 - Update to Havana release
537
538 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
539 - Update to Havana rc2
540 - openstack-ceilometer-alarm now depends on python-ceilometerclient
541
542 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
543 - Update to Havana rc1
544 - Separate out the new alarm services to the 'alarm' subpackage
545
546 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
547 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
548
549 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
550 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
551
552 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
553 - Depend on python-alembic
554
555 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
556 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
557
558 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
559 - Update to Havana milestone 3
560
561 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
562 - Avoid python runtime dependency management
563
564 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
565 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
566
567 * Thu Jun  6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
568 - Fix uninstall for openstack-ceilometer-central
569
570 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
571 - Havana milestone 1
572
573 * Mon Apr  8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
574 - Grizzly release
575
576 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3
577 - Initial package