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
63 Requires: python-babel
64 Requires: python-eventlet >= 0.13.0
65 Requires: python-iso8601 >= 0.1.9
66 Requires: python-lxml >= 2.3
67 Requires: python-anyjson >= 0.3.3
68 Requires: python-jsonpath-rw >= 1.2.0, python-jsonpath-rw < 2.0
69 Requires: python-stevedore >= 0.14
70 Requires: python-msgpack >= 0.4.0
71 Requires: python-posix_ipc
72 Requires: python-six >= 1.7.0
75 Requires: python-argparse
76 Requires: python-croniter >= 0.3.4
77 Requires: python-happybase >= 0.5, python-happybase < 0.7, python-happybase > 0.7
78 Requires: python-jsonschema >= 2.0.0, python-jsonschema < 3.0.0
79 Requires: python-lockfile >= 0.8
80 Requires: python-netaddr >= 0.7.6
81 Requires: python-pbr >= 0.6, python-pbr < 0.7, python-pbr > 0.7, python-pbr < 1.0
82 Requires: python-requests >= 1.1
83 Requires: python-tooz >= 0.3
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.db >= 0.2.0
93 Requires: python-oslo-vmware >= 0.4
94 Requires: python-oslo-utils >= 0.1.1
95 Requires: python-oslo-messaging >= 1.3.0
96 Requires: python-oslo.serialization >= 0.1.0
98 Requires: pysnmp > 4.2.1, pysnmp < 5.0.0
100 Requires: python-croniter >= 0.3.4
102 Requires: python-keystonemiddleware >= 1.0.0
103 Requires: python-paste-deploy >= 1.5.0
105 # These were only added as global dependencies
106 # at the end of the Icehouse cycle with the change
107 # to cli.py referenced from in http://pad.lv/1317210
108 Requires: python-pymongo
109 Requires: python-flask
110 Requires: python-pecan >= 0.5.0
111 Requires: python-wsme >= 0.6
112 Requires: python-neutronclient >= 2.3.5
113 Requires: python-novaclient >= 2.17.0
114 Requires: python-keystoneclient >= 0.9.0
115 Requires: python-glanceclient >= 0.13.1
116 Requires: python-swiftclient >= 2.0.2
117 Requires: python-ceilometerclient >= 1.0.6
118 Requires: libvirt-python
120 %description -n python-ceilometer
121 OpenStack ceilometer provides services to measure and
122 collect metrics from OpenStack components.
124 This package contains the ceilometer python library.
128 Summary: Components common to all OpenStack ceilometer services
129 Group: Applications/System
131 Requires: python-ceilometer = %{version}-%{release}
132 Requires: openstack-utils
134 Requires(post): chkconfig
135 Requires(postun): initscripts
136 Requires(preun): chkconfig
137 Requires(pre): shadow-utils
141 OpenStack ceilometer provides services to measure and
142 collect metrics from OpenStack components.
144 This package contains components common to all OpenStack
149 Summary: OpenStack ceilometer compute agent
150 Group: Applications/System
152 Requires: %{name}-common = %{version}-%{release}
154 Requires: python-novaclient >= 2.17.0
155 Requires: python-keystoneclient >= 0.9.0
156 Requires: libvirt-python
159 OpenStack ceilometer provides services to measure and
160 collect metrics from OpenStack components.
162 This package contains the ceilometer agent for
163 running on OpenStack compute nodes.
167 Summary: OpenStack ceilometer central agent
168 Group: Applications/System
170 Requires: %{name}-common = %{version}-%{release}
172 Requires: python-novaclient >= 2.17.0
173 Requires: python-keystoneclient >= 0.9.0
174 Requires: python-glanceclient >= 0.13.1
175 Requires: python-swiftclient >= 2.0.2
178 OpenStack ceilometer provides services to measure and
179 collect metrics from OpenStack components.
181 This package contains the central ceilometer agent.
185 Summary: OpenStack ceilometer collector
186 Group: Applications/System
188 Requires: %{name}-common = %{version}-%{release}
190 # For compat with older provisioning tools.
191 # Remove when all reference the notification package explicitly
192 Requires: %{name}-notification
194 Requires: python-pymongo
196 %description collector
197 OpenStack ceilometer provides services to measure and
198 collect metrics from OpenStack components.
200 This package contains the ceilometer collector service
201 which collects metrics from the various agents.
204 %package notification
205 Summary: OpenStack ceilometer notification agent
206 Group: Applications/System
208 Requires: %{name}-common = %{version}-%{release}
210 %description notification
211 OpenStack ceilometer provides services to measure and
212 collect metrics from OpenStack components.
214 This package contains the ceilometer notification agent
215 which pushes metrics to the collector service from the
216 various OpenStack services.
220 Summary: OpenStack ceilometer API service
221 Group: Applications/System
223 Requires: %{name}-common = %{version}-%{release}
225 Requires: python-pymongo
226 Requires: python-flask
227 Requires: python-pecan >= 0.4.5
228 Requires: python-wsme >= 0.6
231 OpenStack ceilometer provides services to measure and
232 collect metrics from OpenStack components.
234 This package contains the ceilometer API service.
238 Summary: OpenStack ceilometer alarm services
239 Group: Applications/System
241 Requires: %{name}-common = %{version}-%{release}
242 Requires: python-ceilometerclient >= 1.0.6
245 OpenStack ceilometer provides services to measure and
246 collect metrics from OpenStack components.
248 This package contains the ceilometer alarm notification
249 and evaluation services.
254 Summary: Documentation for OpenStack ceilometer
257 # Required to build module documents
258 BuildRequires: python-eventlet
259 BuildRequires: python-sqlalchemy0.7
260 BuildRequires: python-webob
261 # while not strictly required, quiets the build down when building docs.
262 BuildRequires: python-migrate, python-iso8601
265 OpenStack ceilometer provides services to measure and
266 collect metrics from OpenStack components.
268 This package contains documentation files for ceilometer.
272 %setup -q -n ceilometer-%{version}
274 find . \( -name .gitignore -o -name .placeholder \) -delete
276 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
278 # TODO: Have the following handle multi line entries
279 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
281 # Remove the requirements file so that pbr hooks don't add it
282 # to distutils requires_dist config
283 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
286 %{__python} setup.py build
289 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
291 # docs generation requires everything to be installed first
292 export PYTHONPATH="$( pwd ):$PYTHONPATH"
297 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
298 # Fix hidden-file-or-dir warnings
299 rm -fr build/html/.doctrees build/html/.buildinfo
305 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
306 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
307 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
309 # Install config files
310 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
311 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
312 install -p -D -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
313 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
314 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
315 install -p -D -m 640 etc/ceilometer/event_definitions.yaml %{buildroot}%{_sysconfdir}/ceilometer/event_definitions.yaml
316 install -p -D -m 640 etc/ceilometer/api_paste.ini %{buildroot}%{_sysconfdir}/ceilometer/api_paste.ini
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*
351 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
352 if ! getent passwd ceilometer >/dev/null; then
353 # Id reservation request: https://bugzilla.redhat.com/923891
354 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
359 if [ $1 -eq 1 ] ; then
360 # Initial installation
361 /sbin/chkconfig --add %{name}-compute
365 if [ $1 -eq 1 ] ; then
366 # Initial installation
367 /sbin/chkconfig --add %{name}-collector
371 if [ $1 -eq 1 ] ; then
372 # Initial installation
373 /sbin/chkconfig --add %{name}-notification
377 if [ $1 -eq 1 ] ; then
378 # Initial installation
379 /sbin/chkconfig --add %{name}-api
383 if [ $1 -eq 1 ] ; then
384 # Initial installation
385 /sbin/chkconfig --add %{name}-central
389 if [ $1 -eq 1 ] ; then
390 # Initial installation
391 for svc in alarm-notifier alarm-evaluator; do
392 /sbin/chkconfig --add %{name}-${svc}
397 if [ $1 -eq 0 ] ; then
398 for svc in compute; do
399 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
400 /sbin/chkconfig --del %{name}-${svc}
405 if [ $1 -eq 0 ] ; then
406 for svc in collector; do
407 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
408 /sbin/chkconfig --del %{name}-${svc}
413 if [ $1 -eq 0 ] ; then
414 for svc in notification; do
415 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
416 /sbin/chkconfig --del %{name}-${svc}
421 if [ $1 -eq 0 ] ; then
423 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
424 /sbin/chkconfig --del %{name}-${svc}
429 if [ $1 -eq 0 ] ; then
430 for svc in central; do
431 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
432 /sbin/chkconfig --del %{name}-${svc}
437 if [ $1 -eq 0 ] ; then
438 for svc in alarm-notifier alarm-evaluator; do
439 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
440 /sbin/chkconfig --del %{name}-${svc}
445 if [ $1 -ge 1 ] ; then
446 # Package upgrade, not uninstall
447 for svc in compute; do
448 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
453 if [ $1 -ge 1 ] ; then
454 # Package upgrade, not uninstall
455 for svc in collector; do
456 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
461 if [ $1 -ge 1 ] ; then
462 # Package upgrade, not uninstall
463 for svc in notification; do
464 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
469 if [ $1 -ge 1 ] ; then
470 # Package upgrade, not uninstall
472 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
477 if [ $1 -ge 1 ] ; then
478 # Package upgrade, not uninstall
479 for svc in central; do
480 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
485 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
486 if [ $1 -ge 1 ] ; then
487 # Package upgrade, not uninstall
488 for svc in alarm-notifier alarm-evaluator; do
489 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
496 %dir %{_sysconfdir}/ceilometer
497 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
498 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
499 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
500 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
501 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/api_paste.ini
502 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/event_definitions.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-agent-ipmi
509 %{_bindir}/ceilometer-dbsync
510 %{_bindir}/ceilometer-expirer
511 %{_bindir}/ceilometer-rootwrap
512 %{_bindir}/ceilometer-send-sample
515 %defattr(-, ceilometer, ceilometer, -)
516 %dir %{_sharedstatedir}/ceilometer
517 %dir %{_sharedstatedir}/ceilometer/tmp
520 %files -n python-ceilometer
521 %{python_sitelib}/ceilometer
522 %{python_sitelib}/ceilometer-%{version}*.egg-info
532 %{_bindir}/ceilometer-agent-compute
533 %{_initrddir}/%{name}-compute
534 %{_datarootdir}/ceilometer/%{name}-compute.upstart
538 %{_bindir}/ceilometer-collector*
539 %{_initrddir}/%{name}-collector
540 %{_datarootdir}/ceilometer/%{name}-collector.upstart
544 %{_bindir}/ceilometer-agent-notification
545 %{_initrddir}/%{name}-notification
546 %{_datarootdir}/ceilometer/%{name}-notification.upstart
550 %{_bindir}/ceilometer-api
551 %{_initrddir}/%{name}-api
552 %{_datarootdir}/ceilometer/%{name}-api.upstart
556 %{_bindir}/ceilometer-agent-central
557 %{_initrddir}/%{name}-central
558 %{_datarootdir}/ceilometer/%{name}-central.upstart
562 %{_bindir}/ceilometer-alarm-notifier
563 %{_bindir}/ceilometer-alarm-evaluator
564 %{_initrddir}/%{name}-alarm-notifier
565 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
566 %{_initrddir}/%{name}-alarm-evaluator
567 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
571 * Fri Jul 4 2014 Ivan Berezovskiy <iberezovskiy@mirantis.com> - 2014.2.b1
572 - Update to upstream 2014.2.b1
573 - Update requirements
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