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-sqlalchemy
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
74 Requires: python-argparse
75 Requires: python-croniter >= 0.3.4
76 Requires: python-jsonschema
77 Requires: python-lockfile >= 0.8
78 Requires: python-netaddr
80 Requires: python-requests
82 Requires: python-sqlalchemy >= 0.7.8, python-sqlalchemy < 0.9.5, python-sqlalchemy > 0.9.5, python-sqlalchemy <= 0.9.99
83 Requires: python-alembic
84 Requires: python-migrate >= 0.8.2, python-migrate < 0.8.4, python-migrate > 0.8.4
85 Requires: python-happybase >= 0.5, python-happybase < 0.7, python-happybase > 0.7
87 Requires: python-webob >= 1.2.3
89 Requires: python-oslo-config >= 1:1.2.0
90 Requires: python-oslo.vmware >= 0.2
94 Requires: python-croniter
96 # These were only added as global dependencies
97 # at the end of the Icehouse cycle with the change
98 # to cli.py referenced from in http://pad.lv/1317210
99 Requires: python-pymongo
100 Requires: python-flask
101 Requires: python-pecan >= 0.4.5
102 Requires: python-wsme >= 0.6
103 Requires: python-novaclient
104 Requires: python-keystoneclient
105 Requires: python-glanceclient
106 Requires: python-swiftclient
107 Requires: python-ceilometerclient
108 Requires: libvirt-python
110 %description -n python-ceilometer
111 OpenStack ceilometer provides services to measure and
112 collect metrics from OpenStack components.
114 This package contains the ceilometer python library.
118 Summary: Components common to all OpenStack ceilometer services
119 Group: Applications/System
121 Requires: python-ceilometer = %{version}-%{release}
122 Requires: openstack-utils
124 Requires(post): chkconfig
125 Requires(postun): initscripts
126 Requires(preun): chkconfig
127 Requires(pre): shadow-utils
132 OpenStack ceilometer provides services to measure and
133 collect metrics from OpenStack components.
135 This package contains components common to all OpenStack
140 Summary: OpenStack ceilometer compute agent
141 Group: Applications/System
143 Requires: %{name}-common = %{version}-%{release}
145 Requires: python-novaclient
146 Requires: python-keystoneclient
147 Requires: libvirt-python
150 OpenStack ceilometer provides services to measure and
151 collect metrics from OpenStack components.
153 This package contains the ceilometer agent for
154 running on OpenStack compute nodes.
158 Summary: OpenStack ceilometer central agent
159 Group: Applications/System
161 Requires: %{name}-common = %{version}-%{release}
163 Requires: python-novaclient
164 Requires: python-keystoneclient
165 Requires: python-glanceclient
166 Requires: python-swiftclient
169 OpenStack ceilometer provides services to measure and
170 collect metrics from OpenStack components.
172 This package contains the central ceilometer agent.
176 Summary: OpenStack ceilometer collector
177 Group: Applications/System
179 Requires: %{name}-common = %{version}-%{release}
181 # For compat with older provisioning tools.
182 # Remove when all reference the notification package explicitly
183 Requires: %{name}-notification
185 Requires: python-pymongo
187 %description collector
188 OpenStack ceilometer provides services to measure and
189 collect metrics from OpenStack components.
191 This package contains the ceilometer collector service
192 which collects metrics from the various agents.
195 %package notification
196 Summary: OpenStack ceilometer notification agent
197 Group: Applications/System
199 Requires: %{name}-common = %{version}-%{release}
201 %description notification
202 OpenStack ceilometer provides services to measure and
203 collect metrics from OpenStack components.
205 This package contains the ceilometer notification agent
206 which pushes metrics to the collector service from the
207 various OpenStack services.
211 Summary: OpenStack ceilometer API service
212 Group: Applications/System
214 Requires: %{name}-common = %{version}-%{release}
216 Requires: python-pymongo
217 Requires: python-flask
218 Requires: python-pecan >= 0.4.5
219 Requires: python-wsme >= 0.6
222 OpenStack ceilometer provides services to measure and
223 collect metrics from OpenStack components.
225 This package contains the ceilometer API service.
229 Summary: OpenStack ceilometer alarm services
230 Group: Applications/System
232 Requires: %{name}-common = %{version}-%{release}
233 Requires: python-ceilometerclient
236 OpenStack ceilometer provides services to measure and
237 collect metrics from OpenStack components.
239 This package contains the ceilometer alarm notification
240 and evaluation services.
245 Summary: Documentation for OpenStack ceilometer
248 # Required to build module documents
249 BuildRequires: python-eventlet
250 BuildRequires: python-sqlalchemy
251 BuildRequires: python-webob
252 # while not strictly required, quiets the build down when building docs.
253 BuildRequires: python-migrate, python-iso8601
256 OpenStack ceilometer provides services to measure and
257 collect metrics from OpenStack components.
259 This package contains documentation files for ceilometer.
263 %setup -q -n ceilometer-%{version}
268 find . \( -name .gitignore -o -name .placeholder \) -delete
270 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
272 # TODO: Have the following handle multi line entries
273 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
275 # Remove the requirements file so that pbr hooks don't add it
276 # to distutils requires_dist config
277 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
279 # Programmatically update defaults in sample config
280 # which is installed at /etc/ceilometer/ceilometer.conf
281 # TODO: Make this more robust
282 # Note it only edits the first occurance, so assumes a section ordering in sample
283 # and also doesn't support multi-valued variables.
284 while read name eq value; do
285 test "$name" && test "$value" || continue
286 sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
290 %{__python} setup.py build
293 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
295 # docs generation requires everything to be installed first
296 export PYTHONPATH="$( pwd ):$PYTHONPATH"
301 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
302 # Fix hidden-file-or-dir warnings
303 rm -fr build/html/.doctrees build/html/.buildinfo
309 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
310 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
311 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
313 # Install config files
314 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
315 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
316 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
317 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
318 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
319 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
321 # Install initscripts for services
322 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
323 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
324 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
325 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
326 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
327 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
328 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
330 # Install upstart jobs examples
331 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
332 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
333 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
334 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
335 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
336 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
337 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
338 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
341 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
343 # Install pid directory
344 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
346 # Remove unneeded in production stuff
347 rm -f %{buildroot}%{_bindir}/ceilometer-debug
348 rm -fr %{buildroot}%{python_sitelib}/tests/
349 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
350 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
351 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
355 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
356 if ! getent passwd ceilometer >/dev/null; then
357 # Id reservation request: https://bugzilla.redhat.com/923891
358 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
363 if [ $1 -eq 1 ] ; then
364 # Initial installation
365 /sbin/chkconfig --add %{name}-compute
369 if [ $1 -eq 1 ] ; then
370 # Initial installation
371 /sbin/chkconfig --add %{name}-collector
375 if [ $1 -eq 1 ] ; then
376 # Initial installation
377 /sbin/chkconfig --add %{name}-notification
381 if [ $1 -eq 1 ] ; then
382 # Initial installation
383 /sbin/chkconfig --add %{name}-api
387 if [ $1 -eq 1 ] ; then
388 # Initial installation
389 /sbin/chkconfig --add %{name}-central
393 if [ $1 -eq 1 ] ; then
394 # Initial installation
395 for svc in alarm-notifier alarm-evaluator; do
396 /sbin/chkconfig --add %{name}-${svc}
401 if [ $1 -eq 0 ] ; then
402 for svc in compute; do
403 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
404 /sbin/chkconfig --del %{name}-${svc}
409 if [ $1 -eq 0 ] ; then
410 for svc in collector; do
411 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
412 /sbin/chkconfig --del %{name}-${svc}
417 if [ $1 -eq 0 ] ; then
418 for svc in notification; do
419 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
420 /sbin/chkconfig --del %{name}-${svc}
425 if [ $1 -eq 0 ] ; then
427 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
428 /sbin/chkconfig --del %{name}-${svc}
433 if [ $1 -eq 0 ] ; then
434 for svc in central; do
435 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
436 /sbin/chkconfig --del %{name}-${svc}
441 if [ $1 -eq 0 ] ; then
442 for svc in alarm-notifier alarm-evaluator; do
443 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
444 /sbin/chkconfig --del %{name}-${svc}
449 if [ $1 -ge 1 ] ; then
450 # Package upgrade, not uninstall
451 for svc in compute; do
452 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
457 if [ $1 -ge 1 ] ; then
458 # Package upgrade, not uninstall
459 for svc in collector; do
460 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
465 if [ $1 -ge 1 ] ; then
466 # Package upgrade, not uninstall
467 for svc in notification; do
468 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
473 if [ $1 -ge 1 ] ; then
474 # Package upgrade, not uninstall
476 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
481 if [ $1 -ge 1 ] ; then
482 # Package upgrade, not uninstall
483 for svc in central; do
484 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
489 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
490 if [ $1 -ge 1 ] ; then
491 # Package upgrade, not uninstall
492 for svc in alarm-notifier alarm-evaluator; do
493 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
500 %dir %{_sysconfdir}/ceilometer
501 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
502 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
503 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
504 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
505 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
506 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
508 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
509 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
511 %{_bindir}/ceilometer-dbsync
512 %{_bindir}/ceilometer-expirer
513 %{_bindir}/ceilometer-send-sample
516 %defattr(-, ceilometer, ceilometer, -)
517 %dir %{_sharedstatedir}/ceilometer
518 %dir %{_sharedstatedir}/ceilometer/tmp
521 %files -n python-ceilometer
522 %{python_sitelib}/ceilometer
523 %{python_sitelib}/ceilometer-%{version}*.egg-info
533 %{_bindir}/ceilometer-agent-compute
534 %{_initrddir}/%{name}-compute
535 %{_datarootdir}/ceilometer/%{name}-compute.upstart
539 %{_bindir}/ceilometer-collector*
540 %{_initrddir}/%{name}-collector
541 %{_datarootdir}/ceilometer/%{name}-collector.upstart
545 %{_bindir}/ceilometer-agent-notification
546 %{_initrddir}/%{name}-notification
547 %{_datarootdir}/ceilometer/%{name}-notification.upstart
551 %doc ceilometer/api/v1/static/LICENSE.*
552 %{_bindir}/ceilometer-api
553 %{_initrddir}/%{name}-api
554 %{_datarootdir}/ceilometer/%{name}-api.upstart
558 %{_bindir}/ceilometer-agent-central
559 %{_initrddir}/%{name}-central
560 %{_datarootdir}/ceilometer/%{name}-central.upstart
564 %{_bindir}/ceilometer-alarm-notifier
565 %{_bindir}/ceilometer-alarm-evaluator
566 %{_initrddir}/%{name}-alarm-notifier
567 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
568 %{_initrddir}/%{name}-alarm-evaluator
569 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
573 * Wed Jun 11 2014 Steve Linabery <slinaber@redhat.com> - 2014.1.1-2
574 - Update to upstream 2014.1.1
575 - fix message routing with newer QPID (rhbz#1103800)
577 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2014.1-3
578 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
580 * Wed May 07 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-2
581 - Avoid dependency issues with distributed installs (#1095414)
583 * Thu Apr 17 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-1
584 - Update to Icehouse release
586 * Fri Apr 11 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.7.rc2
587 - Update to upstream 2014.1.rc2
588 - Remove qpid as default rpc backend
589 - Split out openstack-ceilometer-notification subpackage from collector
591 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
592 - Update to upstream 2014.1.rc1
594 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
595 - Update to Icehouse milestone 3
597 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
598 - Fix missing dependency on python-babel
600 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
601 - Update to Icehouse milestone 2
603 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
604 - Set python-six min version to ensure updated
606 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
607 - Update to Icehouse milestone 1
609 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
610 - Update to Havana stable release 2013.2.1
612 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
613 - Update to Havana release
615 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
616 - Update to Havana rc2
617 - openstack-ceilometer-alarm now depends on python-ceilometerclient
619 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
620 - Update to Havana rc1
621 - Separate out the new alarm services to the 'alarm' subpackage
623 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
624 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
626 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
627 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
629 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
630 - Depend on python-alembic
632 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
633 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
635 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
636 - Update to Havana milestone 3
638 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
639 - Avoid python runtime dependency management
641 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
642 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
644 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
645 - Fix uninstall for openstack-ceilometer-central
647 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
650 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
653 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3