2 %global with_doc %{!?_without_doc:1}%{?_without_doc:0}
3 %global pypi_name ceilometer
5 Name: openstack-ceilometer
8 Summary: OpenStack measurement collection service
10 Group: Applications/System
12 URL: https://wiki.openstack.org/wiki/Ceilometer
13 Source0: http://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
14 Source1: %{pypi_name}-dist.conf
15 Source2: %{pypi_name}.logrotate
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
32 # This is EL6 specific and not upstream
33 Patch100: openstack-ceilometer-newdeps.patch
36 BuildRequires: intltool
37 BuildRequires: python-sphinx10
38 BuildRequires: python-setuptools
39 BuildRequires: python-pbr
40 BuildRequires: python-d2to1
41 BuildRequires: python2-devel
43 BuildRequires: openstack-utils
45 # These are required to build due to the requirements check added
46 BuildRequires: python-sqlalchemy0.7
47 BuildRequires: python-webob1.2
51 OpenStack ceilometer provides services to measure and
52 collect metrics from OpenStack components.
55 %package -n python-ceilometer
56 Summary: OpenStack ceilometer python libraries
57 Group: Applications/System
60 Requires: python-kombu
62 Requires: python-babel
63 Requires: python-eventlet
64 Requires: python-greenlet
65 Requires: python-iso8601
67 Requires: python-anyjson
68 Requires: python-jsonpath-rw
69 Requires: python-stevedore >= 0.14
70 Requires: python-msgpack
71 Requires: python-six >= 1.6
74 Requires: python-argparse
75 Requires: python-jsonschema
76 Requires: python-netaddr
77 Requires: python-requests
79 Requires: python-sqlalchemy0.7
80 Requires: python-alembic
81 Requires: python-migrate
83 Requires: python-webob >= 1.2.3
85 Requires: python-oslo-config >= 1:1.2.0
89 Requires: python-croniter
91 # These were only added as global dependencies
92 # at the end of the Icehouse cycle with the change
93 # to cli.py referenced from in http://pad.lv/1317210
94 Requires: python-pymongo
95 Requires: python-flask
96 Requires: python-pecan >= 0.4.5
97 Requires: python-wsme >= 0.6
98 Requires: python-novaclient
99 Requires: python-keystoneclient
100 Requires: python-glanceclient
101 Requires: python-swiftclient
102 Requires: python-ceilometerclient
103 Requires: libvirt-python
105 %description -n python-ceilometer
106 OpenStack ceilometer provides services to measure and
107 collect metrics from OpenStack components.
109 This package contains the ceilometer python library.
113 Summary: Components common to all OpenStack ceilometer services
114 Group: Applications/System
116 Requires: python-ceilometer = %{version}-%{release}
117 Requires: openstack-utils
119 Requires(post): chkconfig
120 Requires(postun): initscripts
121 Requires(preun): chkconfig
122 Requires(pre): shadow-utils
127 OpenStack ceilometer provides services to measure and
128 collect metrics from OpenStack components.
130 This package contains components common to all OpenStack
135 Summary: OpenStack ceilometer compute agent
136 Group: Applications/System
138 Requires: %{name}-common = %{version}-%{release}
140 Requires: python-novaclient
141 Requires: python-keystoneclient
142 Requires: libvirt-python
145 OpenStack ceilometer provides services to measure and
146 collect metrics from OpenStack components.
148 This package contains the ceilometer agent for
149 running on OpenStack compute nodes.
153 Summary: OpenStack ceilometer central agent
154 Group: Applications/System
156 Requires: %{name}-common = %{version}-%{release}
158 Requires: python-novaclient
159 Requires: python-keystoneclient
160 Requires: python-glanceclient
161 Requires: python-swiftclient
164 OpenStack ceilometer provides services to measure and
165 collect metrics from OpenStack components.
167 This package contains the central ceilometer agent.
171 Summary: OpenStack ceilometer collector
172 Group: Applications/System
174 Requires: %{name}-common = %{version}-%{release}
176 # For compat with older provisioning tools.
177 # Remove when all reference the notification package explicitly
178 Requires: %{name}-notification
180 Requires: python-pymongo
182 %description collector
183 OpenStack ceilometer provides services to measure and
184 collect metrics from OpenStack components.
186 This package contains the ceilometer collector service
187 which collects metrics from the various agents.
190 %package notification
191 Summary: OpenStack ceilometer notification agent
192 Group: Applications/System
194 Requires: %{name}-common = %{version}-%{release}
196 %description notification
197 OpenStack ceilometer provides services to measure and
198 collect metrics from OpenStack components.
200 This package contains the ceilometer notification agent
201 which pushes metrics to the collector service from the
202 various OpenStack services.
206 Summary: OpenStack ceilometer API service
207 Group: Applications/System
209 Requires: %{name}-common = %{version}-%{release}
211 Requires: python-pymongo
212 Requires: python-flask
213 Requires: python-pecan >= 0.4.5
214 Requires: python-wsme >= 0.6
217 OpenStack ceilometer provides services to measure and
218 collect metrics from OpenStack components.
220 This package contains the ceilometer API service.
224 Summary: OpenStack ceilometer alarm services
225 Group: Applications/System
227 Requires: %{name}-common = %{version}-%{release}
228 Requires: python-ceilometerclient
231 OpenStack ceilometer provides services to measure and
232 collect metrics from OpenStack components.
234 This package contains the ceilometer alarm notification
235 and evaluation services.
240 Summary: Documentation for OpenStack ceilometer
243 # Required to build module documents
244 BuildRequires: python-eventlet
245 BuildRequires: python-sqlalchemy0.7
246 BuildRequires: python-webob
247 # while not strictly required, quiets the build down when building docs.
248 BuildRequires: python-migrate, python-iso8601
251 OpenStack ceilometer provides services to measure and
252 collect metrics from OpenStack components.
254 This package contains documentation files for ceilometer.
258 %setup -q -n ceilometer-%{version}
263 find . \( -name .gitignore -o -name .placeholder \) -delete
265 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
267 # TODO: Have the following handle multi line entries
268 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
270 # Remove the requirements file so that pbr hooks don't add it
271 # to distutils requires_dist config
272 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
274 # Programmatically update defaults in sample config
275 # which is installed at /etc/ceilometer/ceilometer.conf
276 # TODO: Make this more robust
277 # Note it only edits the first occurance, so assumes a section ordering in sample
278 # and also doesn't support multi-valued variables.
279 while read name eq value; do
280 test "$name" && test "$value" || continue
281 sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
285 %{__python} setup.py build
288 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
290 # docs generation requires everything to be installed first
291 export PYTHONPATH="$( pwd ):$PYTHONPATH"
296 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
297 # Fix hidden-file-or-dir warnings
298 rm -fr build/html/.doctrees build/html/.buildinfo
304 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
305 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
306 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
308 # Install config files
309 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
310 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
311 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
312 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
313 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
314 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
316 # Install initscripts for services
317 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
318 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
319 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
320 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
321 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
322 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
323 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
325 # Install upstart jobs examples
326 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
327 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
328 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
329 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
330 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
331 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
332 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
333 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
336 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
338 # Install pid directory
339 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
341 # Remove unneeded in production stuff
342 rm -f %{buildroot}%{_bindir}/ceilometer-debug
343 rm -fr %{buildroot}%{python_sitelib}/tests/
344 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
345 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
346 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
350 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
351 if ! getent passwd ceilometer >/dev/null; then
352 # Id reservation request: https://bugzilla.redhat.com/923891
353 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
358 if [ $1 -eq 1 ] ; then
359 # Initial installation
360 /sbin/chkconfig --add %{name}-compute
364 if [ $1 -eq 1 ] ; then
365 # Initial installation
366 /sbin/chkconfig --add %{name}-collector
370 if [ $1 -eq 1 ] ; then
371 # Initial installation
372 /sbin/chkconfig --add %{name}-notification
376 if [ $1 -eq 1 ] ; then
377 # Initial installation
378 /sbin/chkconfig --add %{name}-api
382 if [ $1 -eq 1 ] ; then
383 # Initial installation
384 /sbin/chkconfig --add %{name}-central
388 if [ $1 -eq 1 ] ; then
389 # Initial installation
390 for svc in alarm-notifier alarm-evaluator; do
391 /sbin/chkconfig --add %{name}-${svc}
396 if [ $1 -eq 0 ] ; then
397 for svc in compute; do
398 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
399 /sbin/chkconfig --del %{name}-${svc}
404 if [ $1 -eq 0 ] ; then
405 for svc in collector; do
406 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
407 /sbin/chkconfig --del %{name}-${svc}
412 if [ $1 -eq 0 ] ; then
413 for svc in notification; do
414 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
415 /sbin/chkconfig --del %{name}-${svc}
420 if [ $1 -eq 0 ] ; then
422 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
423 /sbin/chkconfig --del %{name}-${svc}
428 if [ $1 -eq 0 ] ; then
429 for svc in central; do
430 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
431 /sbin/chkconfig --del %{name}-${svc}
436 if [ $1 -eq 0 ] ; then
437 for svc in alarm-notifier alarm-evaluator; do
438 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
439 /sbin/chkconfig --del %{name}-${svc}
444 if [ $1 -ge 1 ] ; then
445 # Package upgrade, not uninstall
446 for svc in compute; do
447 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
452 if [ $1 -ge 1 ] ; then
453 # Package upgrade, not uninstall
454 for svc in collector; do
455 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
460 if [ $1 -ge 1 ] ; then
461 # Package upgrade, not uninstall
462 for svc in notification; do
463 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
468 if [ $1 -ge 1 ] ; then
469 # Package upgrade, not uninstall
471 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
476 if [ $1 -ge 1 ] ; then
477 # Package upgrade, not uninstall
478 for svc in central; do
479 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
484 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
485 if [ $1 -ge 1 ] ; then
486 # Package upgrade, not uninstall
487 for svc in alarm-notifier alarm-evaluator; do
488 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
495 %dir %{_sysconfdir}/ceilometer
496 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
497 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
498 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
499 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
500 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
501 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
503 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
504 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
506 %{_bindir}/ceilometer-dbsync
507 %{_bindir}/ceilometer-expirer
508 %{_bindir}/ceilometer-send-sample
511 %defattr(-, ceilometer, ceilometer, -)
512 %dir %{_sharedstatedir}/ceilometer
513 %dir %{_sharedstatedir}/ceilometer/tmp
516 %files -n python-ceilometer
517 %{python_sitelib}/ceilometer
518 %{python_sitelib}/ceilometer-%{version}*.egg-info
528 %{_bindir}/ceilometer-agent-compute
529 %{_initrddir}/%{name}-compute
530 %{_datarootdir}/ceilometer/%{name}-compute.upstart
534 %{_bindir}/ceilometer-collector*
535 %{_initrddir}/%{name}-collector
536 %{_datarootdir}/ceilometer/%{name}-collector.upstart
540 %{_bindir}/ceilometer-agent-notification
541 %{_initrddir}/%{name}-notification
542 %{_datarootdir}/ceilometer/%{name}-notification.upstart
546 %doc ceilometer/api/v1/static/LICENSE.*
547 %{_bindir}/ceilometer-api
548 %{_initrddir}/%{name}-api
549 %{_datarootdir}/ceilometer/%{name}-api.upstart
553 %{_bindir}/ceilometer-agent-central
554 %{_initrddir}/%{name}-central
555 %{_datarootdir}/ceilometer/%{name}-central.upstart
559 %{_bindir}/ceilometer-alarm-notifier
560 %{_bindir}/ceilometer-alarm-evaluator
561 %{_initrddir}/%{name}-alarm-notifier
562 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
563 %{_initrddir}/%{name}-alarm-evaluator
564 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
568 * Wed Jun 11 2014 Steve Linabery <slinaber@redhat.com> - 2014.1.1-2
569 - Update to upstream 2014.1.1
570 - fix message routing with newer QPID (rhbz#1103800)
572 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2014.1-3
573 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
575 * Wed May 07 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-2
576 - Avoid dependency issues with distributed installs (#1095414)
578 * Thu Apr 17 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-1
579 - Update to Icehouse release
581 * Fri Apr 11 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.7.rc2
582 - Update to upstream 2014.1.rc2
583 - Remove qpid as default rpc backend
584 - Split out openstack-ceilometer-notification subpackage from collector
586 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
587 - Update to upstream 2014.1.rc1
589 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
590 - Update to Icehouse milestone 3
592 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
593 - Fix missing dependency on python-babel
595 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
596 - Update to Icehouse milestone 2
598 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
599 - Set python-six min version to ensure updated
601 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
602 - Update to Icehouse milestone 1
604 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
605 - Update to Havana stable release 2013.2.1
607 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
608 - Update to Havana release
610 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
611 - Update to Havana rc2
612 - openstack-ceilometer-alarm now depends on python-ceilometerclient
614 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
615 - Update to Havana rc1
616 - Separate out the new alarm services to the 'alarm' subpackage
618 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
619 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
621 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
622 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
624 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
625 - Depend on python-alembic
627 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
628 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
630 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
631 - Update to Havana milestone 3
633 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
634 - Avoid python runtime dependency management
636 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
637 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
639 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
640 - Fix uninstall for openstack-ceilometer-central
642 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
645 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
648 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3