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
33 # patches_base=2014.1.1
35 Patch0001: 0001-Ensure-routing-key-is-specified-in-the-address-for-a.patch
37 # This is EL6 specific and not upstream
38 Patch100: openstack-ceilometer-newdeps.patch
41 BuildRequires: intltool
42 BuildRequires: python-sphinx10
43 BuildRequires: python-setuptools
44 BuildRequires: python-pbr
45 BuildRequires: python-d2to1
46 BuildRequires: python2-devel
48 BuildRequires: openstack-utils
50 # These are required to build due to the requirements check added
51 BuildRequires: python-sqlalchemy0.7
52 BuildRequires: python-webob1.2
56 OpenStack ceilometer provides services to measure and
57 collect metrics from OpenStack components.
60 %package -n python-ceilometer
61 Summary: OpenStack ceilometer python libraries
62 Group: Applications/System
65 Requires: python-kombu
67 Requires: python-babel
68 Requires: python-eventlet
69 Requires: python-greenlet
70 Requires: python-iso8601
72 Requires: python-anyjson
73 Requires: python-jsonpath-rw
74 Requires: python-stevedore >= 0.14
75 Requires: python-msgpack
76 Requires: python-six >= 1.6
79 Requires: python-sqlalchemy0.7
80 Requires: python-alembic
81 Requires: python-migrate
83 Requires: python-webob >= 1.2
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}
265 find . \( -name .gitignore -o -name .placeholder \) -delete
267 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
269 # TODO: Have the following handle multi line entries
270 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
272 # Remove the requirements file so that pbr hooks don't add it
273 # to distutils requires_dist config
274 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
276 # Programmatically update defaults in sample config
277 # which is installed at /etc/ceilometer/ceilometer.conf
278 # TODO: Make this more robust
279 # Note it only edits the first occurance, so assumes a section ordering in sample
280 # and also doesn't support multi-valued variables.
281 while read name eq value; do
282 test "$name" && test "$value" || continue
283 sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
287 %{__python} setup.py build
290 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
292 # docs generation requires everything to be installed first
293 export PYTHONPATH="$( pwd ):$PYTHONPATH"
298 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
299 # Fix hidden-file-or-dir warnings
300 rm -fr build/html/.doctrees build/html/.buildinfo
306 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
307 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
308 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
310 # Install config files
311 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
312 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
313 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
314 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
315 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
316 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
318 # Install initscripts for services
319 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
320 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
321 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
322 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
323 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
324 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
325 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
327 # Install upstart jobs examples
328 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
329 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
330 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
331 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
332 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
333 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
334 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
335 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
338 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
340 # Install pid directory
341 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
343 # Remove unneeded in production stuff
344 rm -f %{buildroot}%{_bindir}/ceilometer-debug
345 rm -fr %{buildroot}%{python_sitelib}/tests/
346 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
347 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
348 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
352 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
353 if ! getent passwd ceilometer >/dev/null; then
354 # Id reservation request: https://bugzilla.redhat.com/923891
355 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
360 if [ $1 -eq 1 ] ; then
361 # Initial installation
362 /sbin/chkconfig --add %{name}-compute
366 if [ $1 -eq 1 ] ; then
367 # Initial installation
368 /sbin/chkconfig --add %{name}-collector
372 if [ $1 -eq 1 ] ; then
373 # Initial installation
374 /sbin/chkconfig --add %{name}-notification
378 if [ $1 -eq 1 ] ; then
379 # Initial installation
380 /sbin/chkconfig --add %{name}-api
384 if [ $1 -eq 1 ] ; then
385 # Initial installation
386 /sbin/chkconfig --add %{name}-central
390 if [ $1 -eq 1 ] ; then
391 # Initial installation
392 for svc in alarm-notifier alarm-evaluator; do
393 /sbin/chkconfig --add %{name}-${svc}
398 if [ $1 -eq 0 ] ; then
399 for svc in compute; do
400 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
401 /sbin/chkconfig --del %{name}-${svc}
406 if [ $1 -eq 0 ] ; then
407 for svc in collector; do
408 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
409 /sbin/chkconfig --del %{name}-${svc}
414 if [ $1 -eq 0 ] ; then
415 for svc in notification; do
416 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
417 /sbin/chkconfig --del %{name}-${svc}
422 if [ $1 -eq 0 ] ; then
424 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
425 /sbin/chkconfig --del %{name}-${svc}
430 if [ $1 -eq 0 ] ; then
431 for svc in central; do
432 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
433 /sbin/chkconfig --del %{name}-${svc}
438 if [ $1 -eq 0 ] ; then
439 for svc in alarm-notifier alarm-evaluator; do
440 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
441 /sbin/chkconfig --del %{name}-${svc}
446 if [ $1 -ge 1 ] ; then
447 # Package upgrade, not uninstall
448 for svc in compute; do
449 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
454 if [ $1 -ge 1 ] ; then
455 # Package upgrade, not uninstall
456 for svc in collector; do
457 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
462 if [ $1 -ge 1 ] ; then
463 # Package upgrade, not uninstall
464 for svc in notification; do
465 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
470 if [ $1 -ge 1 ] ; then
471 # Package upgrade, not uninstall
473 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
478 if [ $1 -ge 1 ] ; then
479 # Package upgrade, not uninstall
480 for svc in central; do
481 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
486 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
487 if [ $1 -ge 1 ] ; then
488 # Package upgrade, not uninstall
489 for svc in alarm-notifier alarm-evaluator; do
490 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
497 %dir %{_sysconfdir}/ceilometer
498 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
499 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
500 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
501 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
502 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
503 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
505 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
506 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
508 %{_bindir}/ceilometer-dbsync
509 %{_bindir}/ceilometer-expirer
510 %{_bindir}/ceilometer-send-sample
513 %defattr(-, ceilometer, ceilometer, -)
514 %dir %{_sharedstatedir}/ceilometer
515 %dir %{_sharedstatedir}/ceilometer/tmp
518 %files -n python-ceilometer
519 %{python_sitelib}/ceilometer
520 %{python_sitelib}/ceilometer-%{version}*.egg-info
530 %{_bindir}/ceilometer-agent-compute
531 %{_initrddir}/%{name}-compute
532 %{_datarootdir}/ceilometer/%{name}-compute.upstart
536 %{_bindir}/ceilometer-collector*
537 %{_initrddir}/%{name}-collector
538 %{_datarootdir}/ceilometer/%{name}-collector.upstart
542 %{_bindir}/ceilometer-agent-notification
543 %{_initrddir}/%{name}-notification
544 %{_datarootdir}/ceilometer/%{name}-notification.upstart
548 %doc ceilometer/api/v1/static/LICENSE.*
549 %{_bindir}/ceilometer-api
550 %{_initrddir}/%{name}-api
551 %{_datarootdir}/ceilometer/%{name}-api.upstart
555 %{_bindir}/ceilometer-agent-central
556 %{_initrddir}/%{name}-central
557 %{_datarootdir}/ceilometer/%{name}-central.upstart
561 %{_bindir}/ceilometer-alarm-notifier
562 %{_bindir}/ceilometer-alarm-evaluator
563 %{_initrddir}/%{name}-alarm-notifier
564 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
565 %{_initrddir}/%{name}-alarm-evaluator
566 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
570 * Wed Jun 11 2014 Steve Linabery <slinaber@redhat.com> - 2014.1.1-2
571 - Update to upstream 2014.1.1
572 - fix message routing with newer QPID (rhbz#1103800)
574 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2014.1-3
575 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
577 * Wed May 07 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-2
578 - Avoid dependency issues with distributed installs (#1095414)
580 * Thu Apr 17 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-1
581 - Update to Icehouse release
583 * Fri Apr 11 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.7.rc2
584 - Update to upstream 2014.1.rc2
585 - Remove qpid as default rpc backend
586 - Split out openstack-ceilometer-notification subpackage from collector
588 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
589 - Update to upstream 2014.1.rc1
591 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
592 - Update to Icehouse milestone 3
594 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
595 - Fix missing dependency on python-babel
597 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
598 - Update to Icehouse milestone 2
600 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
601 - Set python-six min version to ensure updated
603 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
604 - Update to Icehouse milestone 1
606 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
607 - Update to Havana stable release 2013.2.1
609 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
610 - Update to Havana release
612 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
613 - Update to Havana rc2
614 - openstack-ceilometer-alarm now depends on python-ceilometerclient
616 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
617 - Update to Havana rc1
618 - Separate out the new alarm services to the 'alarm' subpackage
620 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
621 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
623 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
624 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
626 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
627 - Depend on python-alembic
629 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
630 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
632 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
633 - Update to Havana milestone 3
635 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
636 - Avoid python runtime dependency management
638 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
639 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
641 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
642 - Fix uninstall for openstack-ceilometer-central
644 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
647 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
650 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3