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
16 Source3: %{pypi_name}.conf.sample
18 Source10: %{name}-api.init
19 Source100: %{name}-api.upstart
20 Source11: %{name}-collector.init
21 Source110: %{name}-collector.upstart
22 Source12: %{name}-compute.init
23 Source120: %{name}-compute.upstart
24 Source13: %{name}-central.init
25 Source130: %{name}-central.upstart
26 Source14: %{name}-alarm-notifier.init
27 Source140: %{name}-alarm-notifier.upstart
28 Source15: %{name}-alarm-evaluator.init
29 Source150: %{name}-alarm-evaluator.upstart
30 Source16: %{name}-notification.init
31 Source160: %{name}-notification.upstart
34 # patches_base=2014.1.1
38 BuildRequires: intltool
39 BuildRequires: python-sphinx10
40 BuildRequires: python-setuptools
41 BuildRequires: python-pbr
42 BuildRequires: python-d2to1
43 BuildRequires: python2-devel
45 BuildRequires: openstack-utils
47 # These are required to build due to the requirements check added
48 BuildRequires: python-sqlalchemy
49 BuildRequires: python-webob1.2
53 OpenStack ceilometer provides services to measure and
54 collect metrics from OpenStack components.
57 %package -n python-ceilometer
58 Summary: OpenStack ceilometer python libraries
59 Group: Applications/System
62 Requires: python-kombu
64 Requires: python-babel
65 Requires: python-eventlet >= 0.13.0
66 Requires: python-iso8601 >= 0.1.9
67 Requires: python-lxml >= 2.3
68 Requires: python-anyjson >= 0.3.3
69 Requires: python-jsonpath-rw >= 1.2.0, python-jsonpath-rw < 2.0
70 Requires: python-stevedore >= 0.14
71 Requires: python-msgpack >= 0.4.0
72 Requires: python-posix_ipc
73 Requires: python-six >= 1.7.0
76 Requires: python-argparse
77 Requires: python-croniter >= 0.3.4
78 Requires: python-happybase >= 0.5, python-happybase < 0.7, python-happybase > 0.7
79 Requires: python-jsonschema >= 2.0.0, python-jsonschema < 3.0.0
80 Requires: python-lockfile >= 0.8
81 Requires: python-netaddr >= 0.7.6
82 Requires: python-pbr >= 0.6, python-pbr < 0.7, python-pbr > 0.7, python-pbr < 1.0
83 Requires: python-requests >= 1.1
85 Requires: python-sqlalchemy >= 0.8.4, python-sqlalchemy < 0.95, python-sqlalchemy > 0.9.5, python-sqlalchemy <= 0.9.99
86 Requires: python-alembic >= 0.6.4
87 Requires: python-migrate >= 0.9.1
89 Requires: python-webob >= 1.2.3
91 Requires: python-oslo-config >= 1:1.2.1
92 Requires: python-oslo-vmware >= 0.4
93 Requires: python-oslo-messaging >= 1.3.0
95 Requires: pysnmp > 4.2.1, pysnmp < 5.0.0
97 Requires: python-croniter
99 Requires: python-keystonemiddleware >= 1.0.0
100 Requires: python-paste-deploy >= 1.5.0
102 # These were only added as global dependencies
103 # at the end of the Icehouse cycle with the change
104 # to cli.py referenced from in http://pad.lv/1317210
105 Requires: python-pymongo
106 Requires: python-flask
107 Requires: python-pecan >= 0.5.0
108 Requires: python-wsme >= 0.6
109 Requires: python-novaclient >= 2.17.0
110 Requires: python-keystoneclient >= 0.9.0
111 Requires: python-glanceclient >= 0.13.1
112 Requires: python-swiftclient >= 2.0.2
113 Requires: python-ceilometerclient >= 1.0.6
114 Requires: libvirt-python
116 %description -n python-ceilometer
117 OpenStack ceilometer provides services to measure and
118 collect metrics from OpenStack components.
120 This package contains the ceilometer python library.
124 Summary: Components common to all OpenStack ceilometer services
125 Group: Applications/System
127 Requires: python-ceilometer = %{version}-%{release}
128 Requires: openstack-utils
130 Requires(post): chkconfig
131 Requires(postun): initscripts
132 Requires(preun): chkconfig
133 Requires(pre): shadow-utils
138 OpenStack ceilometer provides services to measure and
139 collect metrics from OpenStack components.
141 This package contains components common to all OpenStack
146 Summary: OpenStack ceilometer compute agent
147 Group: Applications/System
149 Requires: %{name}-common = %{version}-%{release}
151 Requires: python-novaclient >= 2.17.0
152 Requires: python-keystoneclient >= 0.9.0
153 Requires: libvirt-python
156 OpenStack ceilometer provides services to measure and
157 collect metrics from OpenStack components.
159 This package contains the ceilometer agent for
160 running on OpenStack compute nodes.
164 Summary: OpenStack ceilometer central agent
165 Group: Applications/System
167 Requires: %{name}-common = %{version}-%{release}
169 Requires: python-novaclient >= 2.17.0
170 Requires: python-keystoneclient >= 0.9.0
171 Requires: python-glanceclient >= 0.13.1
172 Requires: python-swiftclient >= 2.0.2
175 OpenStack ceilometer provides services to measure and
176 collect metrics from OpenStack components.
178 This package contains the central ceilometer agent.
182 Summary: OpenStack ceilometer collector
183 Group: Applications/System
185 Requires: %{name}-common = %{version}-%{release}
187 # For compat with older provisioning tools.
188 # Remove when all reference the notification package explicitly
189 Requires: %{name}-notification
191 Requires: python-pymongo
193 %description collector
194 OpenStack ceilometer provides services to measure and
195 collect metrics from OpenStack components.
197 This package contains the ceilometer collector service
198 which collects metrics from the various agents.
201 %package notification
202 Summary: OpenStack ceilometer notification agent
203 Group: Applications/System
205 Requires: %{name}-common = %{version}-%{release}
207 %description notification
208 OpenStack ceilometer provides services to measure and
209 collect metrics from OpenStack components.
211 This package contains the ceilometer notification agent
212 which pushes metrics to the collector service from the
213 various OpenStack services.
217 Summary: OpenStack ceilometer API service
218 Group: Applications/System
220 Requires: %{name}-common = %{version}-%{release}
222 Requires: python-pymongo
223 Requires: python-flask
224 Requires: python-pecan >= 0.4.5
225 Requires: python-wsme >= 0.6
228 OpenStack ceilometer provides services to measure and
229 collect metrics from OpenStack components.
231 This package contains the ceilometer API service.
235 Summary: OpenStack ceilometer alarm services
236 Group: Applications/System
238 Requires: %{name}-common = %{version}-%{release}
239 Requires: python-ceilometerclient >= 1.0.6
242 OpenStack ceilometer provides services to measure and
243 collect metrics from OpenStack components.
245 This package contains the ceilometer alarm notification
246 and evaluation services.
251 Summary: Documentation for OpenStack ceilometer
254 # Required to build module documents
255 BuildRequires: python-eventlet
256 BuildRequires: python-sqlalchemy0.7
257 BuildRequires: python-webob
258 # while not strictly required, quiets the build down when building docs.
259 BuildRequires: python-migrate, python-iso8601
262 OpenStack ceilometer provides services to measure and
263 collect metrics from OpenStack components.
265 This package contains documentation files for ceilometer.
269 %setup -q -n ceilometer-%{version}
271 find . \( -name .gitignore -o -name .placeholder \) -delete
273 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
275 # TODO: Have the following handle multi line entries
276 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
278 # Remove the requirements file so that pbr hooks don't add it
279 # to distutils requires_dist config
280 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
283 %{__python} setup.py build
286 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
288 # docs generation requires everything to be installed first
289 export PYTHONPATH="$( pwd ):$PYTHONPATH"
294 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
295 # Fix hidden-file-or-dir warnings
296 rm -fr build/html/.doctrees build/html/.buildinfo
302 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
303 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
304 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
306 # Install config files
307 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
308 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
309 install -p -D -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
310 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
311 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
312 install -p -D -m 640 etc/ceilometer/event_definitions.yaml %{buildroot}%{_sysconfdir}/ceilometer/event_definitions.yaml
313 install -p -D -m 640 etc/ceilometer/api_paste.ini %{buildroot}%{_sysconfdir}/ceilometer/api_paste.ini
315 # Install initscripts for services
316 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
317 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
318 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
319 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
320 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
321 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
322 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
324 # Install upstart jobs examples
325 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
326 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
327 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
328 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
329 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
330 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
331 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
332 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
335 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
337 # Install pid directory
338 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
340 # Remove unneeded in production stuff
341 rm -f %{buildroot}%{_bindir}/ceilometer-debug
342 rm -fr %{buildroot}%{python_sitelib}/tests/
343 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
344 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
348 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
349 if ! getent passwd ceilometer >/dev/null; then
350 # Id reservation request: https://bugzilla.redhat.com/923891
351 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
356 if [ $1 -eq 1 ] ; then
357 # Initial installation
358 /sbin/chkconfig --add %{name}-compute
362 if [ $1 -eq 1 ] ; then
363 # Initial installation
364 /sbin/chkconfig --add %{name}-collector
368 if [ $1 -eq 1 ] ; then
369 # Initial installation
370 /sbin/chkconfig --add %{name}-notification
374 if [ $1 -eq 1 ] ; then
375 # Initial installation
376 /sbin/chkconfig --add %{name}-api
380 if [ $1 -eq 1 ] ; then
381 # Initial installation
382 /sbin/chkconfig --add %{name}-central
386 if [ $1 -eq 1 ] ; then
387 # Initial installation
388 for svc in alarm-notifier alarm-evaluator; do
389 /sbin/chkconfig --add %{name}-${svc}
394 if [ $1 -eq 0 ] ; then
395 for svc in compute; do
396 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
397 /sbin/chkconfig --del %{name}-${svc}
402 if [ $1 -eq 0 ] ; then
403 for svc in collector; do
404 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
405 /sbin/chkconfig --del %{name}-${svc}
410 if [ $1 -eq 0 ] ; then
411 for svc in notification; do
412 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
413 /sbin/chkconfig --del %{name}-${svc}
418 if [ $1 -eq 0 ] ; then
420 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
421 /sbin/chkconfig --del %{name}-${svc}
426 if [ $1 -eq 0 ] ; then
427 for svc in central; do
428 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
429 /sbin/chkconfig --del %{name}-${svc}
434 if [ $1 -eq 0 ] ; then
435 for svc in alarm-notifier alarm-evaluator; do
436 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
437 /sbin/chkconfig --del %{name}-${svc}
442 if [ $1 -ge 1 ] ; then
443 # Package upgrade, not uninstall
444 for svc in compute; do
445 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
450 if [ $1 -ge 1 ] ; then
451 # Package upgrade, not uninstall
452 for svc in collector; do
453 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
458 if [ $1 -ge 1 ] ; then
459 # Package upgrade, not uninstall
460 for svc in notification; do
461 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
466 if [ $1 -ge 1 ] ; then
467 # Package upgrade, not uninstall
469 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
474 if [ $1 -ge 1 ] ; then
475 # Package upgrade, not uninstall
476 for svc in central; do
477 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
482 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
483 if [ $1 -ge 1 ] ; then
484 # Package upgrade, not uninstall
485 for svc in alarm-notifier alarm-evaluator; do
486 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
493 %dir %{_sysconfdir}/ceilometer
494 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
495 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
496 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
497 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
498 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/api_paste.ini
499 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/event_definitions.yaml
500 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
502 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
503 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
505 %{_bindir}/ceilometer-dbsync
506 %{_bindir}/ceilometer-expirer
507 %{_bindir}/ceilometer-send-sample
510 %defattr(-, ceilometer, ceilometer, -)
511 %dir %{_sharedstatedir}/ceilometer
512 %dir %{_sharedstatedir}/ceilometer/tmp
515 %files -n python-ceilometer
516 %{python_sitelib}/ceilometer
517 %{python_sitelib}/ceilometer-%{version}*.egg-info
527 %{_bindir}/ceilometer-agent-compute
528 %{_initrddir}/%{name}-compute
529 %{_datarootdir}/ceilometer/%{name}-compute.upstart
533 %{_bindir}/ceilometer-collector*
534 %{_initrddir}/%{name}-collector
535 %{_datarootdir}/ceilometer/%{name}-collector.upstart
539 %{_bindir}/ceilometer-agent-notification
540 %{_initrddir}/%{name}-notification
541 %{_datarootdir}/ceilometer/%{name}-notification.upstart
545 %{_bindir}/ceilometer-api
546 %{_initrddir}/%{name}-api
547 %{_datarootdir}/ceilometer/%{name}-api.upstart
551 %{_bindir}/ceilometer-agent-central
552 %{_initrddir}/%{name}-central
553 %{_datarootdir}/ceilometer/%{name}-central.upstart
557 %{_bindir}/ceilometer-alarm-notifier
558 %{_bindir}/ceilometer-alarm-evaluator
559 %{_initrddir}/%{name}-alarm-notifier
560 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
561 %{_initrddir}/%{name}-alarm-evaluator
562 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
566 * Fri Jul 4 2014 Ivan Berezovskiy <iberezovskiy@mirantis.com> - 2014.2.b1
567 - Update to upstream 2014.2.b1
568 - Update requirements
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