2 %global with_doc %{!?_without_doc:1}%{?_without_doc:0}
3 %global pypi_name ceilometer
5 Name: openstack-ceilometer
7 Release: 0.6.rc1%{?dist}
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}.rc1.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.rc1
35 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.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
66 Requires: python-amqplib
68 Requires: python-babel
69 Requires: python-eventlet
70 Requires: python-greenlet
71 Requires: python-iso8601
73 Requires: python-anyjson
74 Requires: python-jsonpath-rw
75 Requires: python-stevedore >= 0.14
76 Requires: python-msgpack
77 Requires: python-six >= 1.4.1
80 Requires: python-sqlalchemy0.7
81 Requires: python-alembic
82 Requires: python-migrate
84 Requires: python-webob >= 1.2
86 Requires: python-oslo-config >= 1:1.2.0
90 Requires: python-croniter
92 %description -n python-ceilometer
93 OpenStack ceilometer provides services to measure and
94 collect metrics from OpenStack components.
96 This package contains the ceilometer python library.
100 Summary: Components common to all OpenStack ceilometer services
101 Group: Applications/System
103 Requires: python-ceilometer = %{version}-%{release}
104 Requires: openstack-utils
106 Requires(post): chkconfig
107 Requires(postun): initscripts
108 Requires(preun): chkconfig
109 Requires(pre): shadow-utils
114 OpenStack ceilometer provides services to measure and
115 collect metrics from OpenStack components.
117 This package contains components common to all OpenStack
122 Summary: OpenStack ceilometer compute agent
123 Group: Applications/System
125 Requires: %{name}-common = %{version}-%{release}
127 Requires: python-novaclient
128 Requires: python-keystoneclient
129 Requires: libvirt-python
132 OpenStack ceilometer provides services to measure and
133 collect metrics from OpenStack components.
135 This package contains the ceilometer agent for
136 running on OpenStack compute nodes.
140 Summary: OpenStack ceilometer central agent
141 Group: Applications/System
143 Requires: %{name}-common = %{version}-%{release}
145 Requires: python-novaclient
146 Requires: python-keystoneclient
147 Requires: python-glanceclient
148 Requires: python-swiftclient
151 OpenStack ceilometer provides services to measure and
152 collect metrics from OpenStack components.
154 This package contains the central ceilometer agent.
158 Summary: OpenStack ceilometer collector agent
159 Group: Applications/System
161 Requires: %{name}-common = %{version}-%{release}
163 Requires: python-pymongo
165 %description collector
166 OpenStack ceilometer provides services to measure and
167 collect metrics from OpenStack components.
169 This package contains the ceilometer collector agent.
173 Summary: OpenStack ceilometer API service
174 Group: Applications/System
176 Requires: %{name}-common = %{version}-%{release}
178 Requires: python-pymongo
179 Requires: python-flask
180 Requires: python-pecan >= 0.4.5
181 Requires: python-wsme >= 0.6
184 OpenStack ceilometer provides services to measure and
185 collect metrics from OpenStack components.
187 This package contains the ceilometer API service.
191 Summary: OpenStack ceilometer alarm services
192 Group: Applications/System
194 Requires: %{name}-common = %{version}-%{release}
195 Requires: python-ceilometerclient
198 OpenStack ceilometer provides services to measure and
199 collect metrics from OpenStack components.
201 This package contains the ceilometer alarm notification
202 and evaluation services.
207 Summary: Documentation for OpenStack ceilometer
210 # Required to build module documents
211 BuildRequires: python-eventlet
212 BuildRequires: python-sqlalchemy0.7
213 BuildRequires: python-webob
214 # while not strictly required, quiets the build down when building docs.
215 BuildRequires: python-migrate, python-iso8601
218 OpenStack ceilometer provides services to measure and
219 collect metrics from OpenStack components.
221 This package contains documentation files for ceilometer.
225 %setup -q -n ceilometer-%{version}
232 find . \( -name .gitignore -o -name .placeholder \) -delete
234 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
236 # TODO: Have the following handle multi line entries
237 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
239 # Remove the requirements file so that pbr hooks don't add it
240 # to distutils requires_dist config
241 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
243 # Programmatically update defaults in sample config
244 # which is installed at /etc/ceilometer/ceilometer.conf
245 # TODO: Make this more robust
246 # Note it only edits the first occurance, so assumes a section ordering in sample
247 # and also doesn't support multi-valued variables.
248 while read name eq value; do
249 test "$name" && test "$value" || continue
250 sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
254 %{__python} setup.py build
257 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
259 # docs generation requires everything to be installed first
260 export PYTHONPATH="$( pwd ):$PYTHONPATH"
265 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
266 # Fix hidden-file-or-dir warnings
267 rm -fr build/html/.doctrees build/html/.buildinfo
273 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
274 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
275 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
277 # Install config files
278 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
279 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
280 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
281 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
282 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
283 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
285 # Install initscripts for services
286 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
287 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
288 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
289 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
290 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
291 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
292 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
294 # Install upstart jobs examples
295 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
296 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
297 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
298 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
299 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
300 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
301 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
302 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
305 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
307 # Install pid directory
308 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
310 # Remove unneeded in production stuff
311 rm -f %{buildroot}%{_bindir}/ceilometer-debug
312 rm -fr %{buildroot}%{python_sitelib}/tests/
313 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
314 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
315 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
319 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
320 if ! getent passwd ceilometer >/dev/null; then
321 # Id reservation request: https://bugzilla.redhat.com/923891
322 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
327 if [ $1 -eq 1 ] ; then
328 # Initial installation
329 /sbin/chkconfig --add %{name}-compute
333 if [ $1 -eq 1 ] ; then
334 # Initial installation
335 /sbin/chkconfig --add %{name}-collector
339 if [ $1 -eq 1 ] ; then
340 # Initial installation
341 /sbin/chkconfig --add %{name}-api
345 if [ $1 -eq 1 ] ; then
346 # Initial installation
347 /sbin/chkconfig --add %{name}-central
351 if [ $1 -eq 1 ] ; then
352 # Initial installation
353 for svc in alarm-notifier alarm-evaluator; do
354 /sbin/chkconfig --add %{name}-${svc}
359 if [ $1 -eq 0 ] ; then
360 for svc in compute; do
361 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
362 /sbin/chkconfig --del %{name}-${svc}
367 if [ $1 -eq 0 ] ; then
368 for svc in collector notification; do
369 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
370 /sbin/chkconfig --del %{name}-${svc}
375 if [ $1 -eq 0 ] ; then
377 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
378 /sbin/chkconfig --del %{name}-${svc}
383 if [ $1 -eq 0 ] ; then
384 for svc in central; do
385 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
386 /sbin/chkconfig --del %{name}-${svc}
391 if [ $1 -eq 0 ] ; then
392 for svc in alarm-notifier alarm-evaluator; do
393 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
394 /sbin/chkconfig --del %{name}-${svc}
399 if [ $1 -ge 1 ] ; then
400 # Package upgrade, not uninstall
401 for svc in compute; do
402 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
407 if [ $1 -ge 1 ] ; then
408 # Package upgrade, not uninstall
409 for svc in collector notification; do
410 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
415 if [ $1 -ge 1 ] ; then
416 # Package upgrade, not uninstall
418 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
423 if [ $1 -ge 1 ] ; then
424 # Package upgrade, not uninstall
425 for svc in central; do
426 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
431 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
432 if [ $1 -ge 1 ] ; then
433 # Package upgrade, not uninstall
434 for svc in alarm-notifier alarm-evaluator; do
435 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
442 %dir %{_sysconfdir}/ceilometer
443 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
444 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
445 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
446 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
447 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
448 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
450 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
451 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
453 %{_bindir}/ceilometer-dbsync
454 %{_bindir}/ceilometer-expirer
455 %{_bindir}/ceilometer-send-sample
458 %defattr(-, ceilometer, ceilometer, -)
459 %dir %{_sharedstatedir}/ceilometer
460 %dir %{_sharedstatedir}/ceilometer/tmp
463 %files -n python-ceilometer
464 %{python_sitelib}/ceilometer
465 %{python_sitelib}/ceilometer-%{version}*.egg-info
475 %{_bindir}/ceilometer-agent-compute
476 %{_initrddir}/%{name}-compute
477 %{_datarootdir}/ceilometer/%{name}-compute.upstart
481 %{_bindir}/ceilometer-collector*
482 %{_bindir}/ceilometer-agent-notification
483 %{_initrddir}/%{name}-collector
484 %{_initrddir}/%{name}-notification
485 %{_datarootdir}/ceilometer/%{name}-collector.upstart
486 %{_datarootdir}/ceilometer/%{name}-notification.upstart
490 %doc ceilometer/api/v1/static/LICENSE.*
491 %{_bindir}/ceilometer-api
492 %{_initrddir}/%{name}-api
493 %{_datarootdir}/ceilometer/%{name}-api.upstart
497 %{_bindir}/ceilometer-agent-central
498 %{_initrddir}/%{name}-central
499 %{_datarootdir}/ceilometer/%{name}-central.upstart
503 %{_bindir}/ceilometer-alarm-notifier
504 %{_bindir}/ceilometer-alarm-evaluator
505 %{_initrddir}/%{name}-alarm-notifier
506 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
507 %{_initrddir}/%{name}-alarm-evaluator
508 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
512 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
513 - Update to upstream 2014.1.rc1
515 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
516 - Update to Icehouse milestone 3
518 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
519 - Fix missing dependency on python-babel
521 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
522 - Update to Icehouse milestone 2
524 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
525 - Set python-six min version to ensure updated
527 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
528 - Update to Icehouse milestone 1
530 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
531 - Update to Havana stable release 2013.2.1
533 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
534 - Update to Havana release
536 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
537 - Update to Havana rc2
538 - openstack-ceilometer-alarm now depends on python-ceilometerclient
540 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
541 - Update to Havana rc1
542 - Separate out the new alarm services to the 'alarm' subpackage
544 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
545 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
547 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
548 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
550 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
551 - Depend on python-alembic
553 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
554 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
556 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
557 - Update to Havana milestone 3
559 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
560 - Avoid python runtime dependency management
562 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
563 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
565 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
566 - Fix uninstall for openstack-ceilometer-central
568 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
571 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
574 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3