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-argparse
80 Requires: python-jsonschema
81 Requires: python-netaddr
82 Requires: python-requests
84 Requires: python-sqlalchemy0.7
85 Requires: python-alembic
86 Requires: python-migrate
88 Requires: python-webob >= 1.2.3
90 Requires: python-oslo-config >= 1:1.2.0
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-sqlalchemy0.7
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}
270 find . \( -name .gitignore -o -name .placeholder \) -delete
272 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
274 # TODO: Have the following handle multi line entries
275 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
277 # Remove the requirements file so that pbr hooks don't add it
278 # to distutils requires_dist config
279 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
281 # Programmatically update defaults in sample config
282 # which is installed at /etc/ceilometer/ceilometer.conf
283 # TODO: Make this more robust
284 # Note it only edits the first occurance, so assumes a section ordering in sample
285 # and also doesn't support multi-valued variables.
286 while read name eq value; do
287 test "$name" && test "$value" || continue
288 sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
292 %{__python} setup.py build
295 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
297 # docs generation requires everything to be installed first
298 export PYTHONPATH="$( pwd ):$PYTHONPATH"
303 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
304 # Fix hidden-file-or-dir warnings
305 rm -fr build/html/.doctrees build/html/.buildinfo
311 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
312 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
313 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
315 # Install config files
316 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
317 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
318 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
319 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
320 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
321 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
323 # Install initscripts for services
324 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
325 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
326 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
327 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
328 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
329 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
330 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
332 # Install upstart jobs examples
333 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
334 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
335 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
336 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
337 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
338 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
339 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
340 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
343 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
345 # Install pid directory
346 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
348 # Remove unneeded in production stuff
349 rm -f %{buildroot}%{_bindir}/ceilometer-debug
350 rm -fr %{buildroot}%{python_sitelib}/tests/
351 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
352 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
353 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
357 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
358 if ! getent passwd ceilometer >/dev/null; then
359 # Id reservation request: https://bugzilla.redhat.com/923891
360 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
365 if [ $1 -eq 1 ] ; then
366 # Initial installation
367 /sbin/chkconfig --add %{name}-compute
371 if [ $1 -eq 1 ] ; then
372 # Initial installation
373 /sbin/chkconfig --add %{name}-collector
377 if [ $1 -eq 1 ] ; then
378 # Initial installation
379 /sbin/chkconfig --add %{name}-notification
383 if [ $1 -eq 1 ] ; then
384 # Initial installation
385 /sbin/chkconfig --add %{name}-api
389 if [ $1 -eq 1 ] ; then
390 # Initial installation
391 /sbin/chkconfig --add %{name}-central
395 if [ $1 -eq 1 ] ; then
396 # Initial installation
397 for svc in alarm-notifier alarm-evaluator; do
398 /sbin/chkconfig --add %{name}-${svc}
403 if [ $1 -eq 0 ] ; then
404 for svc in compute; do
405 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
406 /sbin/chkconfig --del %{name}-${svc}
411 if [ $1 -eq 0 ] ; then
412 for svc in collector; do
413 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
414 /sbin/chkconfig --del %{name}-${svc}
419 if [ $1 -eq 0 ] ; then
420 for svc in notification; do
421 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
422 /sbin/chkconfig --del %{name}-${svc}
427 if [ $1 -eq 0 ] ; then
429 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
430 /sbin/chkconfig --del %{name}-${svc}
435 if [ $1 -eq 0 ] ; then
436 for svc in central; do
437 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
438 /sbin/chkconfig --del %{name}-${svc}
443 if [ $1 -eq 0 ] ; then
444 for svc in alarm-notifier alarm-evaluator; do
445 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
446 /sbin/chkconfig --del %{name}-${svc}
451 if [ $1 -ge 1 ] ; then
452 # Package upgrade, not uninstall
453 for svc in compute; do
454 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
459 if [ $1 -ge 1 ] ; then
460 # Package upgrade, not uninstall
461 for svc in collector; do
462 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
467 if [ $1 -ge 1 ] ; then
468 # Package upgrade, not uninstall
469 for svc in notification; do
470 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
475 if [ $1 -ge 1 ] ; then
476 # Package upgrade, not uninstall
478 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
483 if [ $1 -ge 1 ] ; then
484 # Package upgrade, not uninstall
485 for svc in central; do
486 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
491 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
492 if [ $1 -ge 1 ] ; then
493 # Package upgrade, not uninstall
494 for svc in alarm-notifier alarm-evaluator; do
495 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
502 %dir %{_sysconfdir}/ceilometer
503 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
504 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
505 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
506 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
507 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
508 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
510 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
511 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
513 %{_bindir}/ceilometer-dbsync
514 %{_bindir}/ceilometer-expirer
515 %{_bindir}/ceilometer-send-sample
518 %defattr(-, ceilometer, ceilometer, -)
519 %dir %{_sharedstatedir}/ceilometer
520 %dir %{_sharedstatedir}/ceilometer/tmp
523 %files -n python-ceilometer
524 %{python_sitelib}/ceilometer
525 %{python_sitelib}/ceilometer-%{version}*.egg-info
535 %{_bindir}/ceilometer-agent-compute
536 %{_initrddir}/%{name}-compute
537 %{_datarootdir}/ceilometer/%{name}-compute.upstart
541 %{_bindir}/ceilometer-collector*
542 %{_initrddir}/%{name}-collector
543 %{_datarootdir}/ceilometer/%{name}-collector.upstart
547 %{_bindir}/ceilometer-agent-notification
548 %{_initrddir}/%{name}-notification
549 %{_datarootdir}/ceilometer/%{name}-notification.upstart
553 %doc ceilometer/api/v1/static/LICENSE.*
554 %{_bindir}/ceilometer-api
555 %{_initrddir}/%{name}-api
556 %{_datarootdir}/ceilometer/%{name}-api.upstart
560 %{_bindir}/ceilometer-agent-central
561 %{_initrddir}/%{name}-central
562 %{_datarootdir}/ceilometer/%{name}-central.upstart
566 %{_bindir}/ceilometer-alarm-notifier
567 %{_bindir}/ceilometer-alarm-evaluator
568 %{_initrddir}/%{name}-alarm-notifier
569 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
570 %{_initrddir}/%{name}-alarm-evaluator
571 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
575 * Wed Jun 11 2014 Steve Linabery <slinaber@redhat.com> - 2014.1.1-2
576 - Update to upstream 2014.1.1
577 - fix message routing with newer QPID (rhbz#1103800)
579 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2014.1-3
580 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
582 * Wed May 07 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-2
583 - Avoid dependency issues with distributed installs (#1095414)
585 * Thu Apr 17 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-1
586 - Update to Icehouse release
588 * Fri Apr 11 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.7.rc2
589 - Update to upstream 2014.1.rc2
590 - Remove qpid as default rpc backend
591 - Split out openstack-ceilometer-notification subpackage from collector
593 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
594 - Update to upstream 2014.1.rc1
596 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
597 - Update to Icehouse milestone 3
599 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
600 - Fix missing dependency on python-babel
602 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
603 - Update to Icehouse milestone 2
605 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
606 - Set python-six min version to ensure updated
608 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
609 - Update to Icehouse milestone 1
611 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
612 - Update to Havana stable release 2013.2.1
614 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
615 - Update to Havana release
617 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
618 - Update to Havana rc2
619 - openstack-ceilometer-alarm now depends on python-ceilometerclient
621 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
622 - Update to Havana rc1
623 - Separate out the new alarm services to the 'alarm' subpackage
625 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
626 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
628 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
629 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
631 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
632 - Depend on python-alembic
634 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
635 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
637 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
638 - Update to Havana milestone 3
640 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
641 - Avoid python runtime dependency management
643 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
644 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
646 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
647 - Fix uninstall for openstack-ceilometer-central
649 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
652 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
655 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3