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
91 Requires: python-pecan
93 %description -n python-ceilometer
94 OpenStack ceilometer provides services to measure and
95 collect metrics from OpenStack components.
97 This package contains the ceilometer python library.
101 Summary: Components common to all OpenStack ceilometer services
102 Group: Applications/System
104 Requires: python-ceilometer = %{version}-%{release}
105 Requires: openstack-utils
107 Requires(post): chkconfig
108 Requires(postun): initscripts
109 Requires(preun): chkconfig
110 Requires(pre): shadow-utils
115 OpenStack ceilometer provides services to measure and
116 collect metrics from OpenStack components.
118 This package contains components common to all OpenStack
123 Summary: OpenStack ceilometer compute agent
124 Group: Applications/System
126 Requires: %{name}-common = %{version}-%{release}
128 Requires: python-novaclient
129 Requires: python-keystoneclient
130 Requires: libvirt-python
131 Requires: python-pecan
134 OpenStack ceilometer provides services to measure and
135 collect metrics from OpenStack components.
137 This package contains the ceilometer agent for
138 running on OpenStack compute nodes.
142 Summary: OpenStack ceilometer central agent
143 Group: Applications/System
145 Requires: %{name}-common = %{version}-%{release}
147 Requires: python-novaclient
148 Requires: python-keystoneclient
149 Requires: python-glanceclient
150 Requires: python-swiftclient
153 OpenStack ceilometer provides services to measure and
154 collect metrics from OpenStack components.
156 This package contains the central ceilometer agent.
160 Summary: OpenStack ceilometer collector agent
161 Group: Applications/System
163 Requires: %{name}-common = %{version}-%{release}
165 Requires: python-pymongo
167 %description collector
168 OpenStack ceilometer provides services to measure and
169 collect metrics from OpenStack components.
171 This package contains the ceilometer collector agent.
175 Summary: OpenStack ceilometer API service
176 Group: Applications/System
178 Requires: %{name}-common = %{version}-%{release}
180 Requires: python-pymongo
181 Requires: python-flask
182 Requires: python-pecan >= 0.4.5
183 Requires: python-wsme >= 0.6
186 OpenStack ceilometer provides services to measure and
187 collect metrics from OpenStack components.
189 This package contains the ceilometer API service.
193 Summary: OpenStack ceilometer alarm services
194 Group: Applications/System
196 Requires: %{name}-common = %{version}-%{release}
197 Requires: python-ceilometerclient
200 OpenStack ceilometer provides services to measure and
201 collect metrics from OpenStack components.
203 This package contains the ceilometer alarm notification
204 and evaluation services.
209 Summary: Documentation for OpenStack ceilometer
212 # Required to build module documents
213 BuildRequires: python-eventlet
214 BuildRequires: python-sqlalchemy0.7
215 BuildRequires: python-webob
216 # while not strictly required, quiets the build down when building docs.
217 BuildRequires: python-migrate, python-iso8601
220 OpenStack ceilometer provides services to measure and
221 collect metrics from OpenStack components.
223 This package contains documentation files for ceilometer.
227 %setup -q -n ceilometer-%{version}
234 find . \( -name .gitignore -o -name .placeholder \) -delete
236 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
238 # TODO: Have the following handle multi line entries
239 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
241 # Remove the requirements file so that pbr hooks don't add it
242 # to distutils requires_dist config
243 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
245 # Programmatically update defaults in sample config
246 # which is installed at /etc/ceilometer/ceilometer.conf
247 # TODO: Make this more robust
248 # Note it only edits the first occurance, so assumes a section ordering in sample
249 # and also doesn't support multi-valued variables.
250 while read name eq value; do
251 test "$name" && test "$value" || continue
252 sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
256 %{__python} setup.py build
259 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
261 # docs generation requires everything to be installed first
262 export PYTHONPATH="$( pwd ):$PYTHONPATH"
267 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
268 # Fix hidden-file-or-dir warnings
269 rm -fr build/html/.doctrees build/html/.buildinfo
275 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
276 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
277 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
279 # Install config files
280 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
281 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
282 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
283 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
284 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
285 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
287 # Install initscripts for services
288 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
289 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
290 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
291 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
292 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
293 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
294 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
296 # Install upstart jobs examples
297 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
298 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
299 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
300 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
301 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
302 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
303 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
304 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
307 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
309 # Install pid directory
310 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
312 # Remove unneeded in production stuff
313 rm -f %{buildroot}%{_bindir}/ceilometer-debug
314 rm -fr %{buildroot}%{python_sitelib}/tests/
315 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
316 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
317 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
321 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
322 if ! getent passwd ceilometer >/dev/null; then
323 # Id reservation request: https://bugzilla.redhat.com/923891
324 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
329 if [ $1 -eq 1 ] ; then
330 # Initial installation
331 /sbin/chkconfig --add %{name}-compute
335 if [ $1 -eq 1 ] ; then
336 # Initial installation
337 /sbin/chkconfig --add %{name}-collector
341 if [ $1 -eq 1 ] ; then
342 # Initial installation
343 /sbin/chkconfig --add %{name}-api
347 if [ $1 -eq 1 ] ; then
348 # Initial installation
349 /sbin/chkconfig --add %{name}-central
353 if [ $1 -eq 1 ] ; then
354 # Initial installation
355 for svc in alarm-notifier alarm-evaluator; do
356 /sbin/chkconfig --add %{name}-${svc}
361 if [ $1 -eq 0 ] ; then
362 for svc in compute; do
363 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
364 /sbin/chkconfig --del %{name}-${svc}
369 if [ $1 -eq 0 ] ; then
370 for svc in collector notification; do
371 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
372 /sbin/chkconfig --del %{name}-${svc}
377 if [ $1 -eq 0 ] ; then
379 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
380 /sbin/chkconfig --del %{name}-${svc}
385 if [ $1 -eq 0 ] ; then
386 for svc in central; do
387 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
388 /sbin/chkconfig --del %{name}-${svc}
393 if [ $1 -eq 0 ] ; then
394 for svc in alarm-notifier alarm-evaluator; do
395 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
396 /sbin/chkconfig --del %{name}-${svc}
401 if [ $1 -ge 1 ] ; then
402 # Package upgrade, not uninstall
403 for svc in compute; do
404 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
409 if [ $1 -ge 1 ] ; then
410 # Package upgrade, not uninstall
411 for svc in collector notification; do
412 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
417 if [ $1 -ge 1 ] ; then
418 # Package upgrade, not uninstall
420 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
425 if [ $1 -ge 1 ] ; then
426 # Package upgrade, not uninstall
427 for svc in central; do
428 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
433 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
434 if [ $1 -ge 1 ] ; then
435 # Package upgrade, not uninstall
436 for svc in alarm-notifier alarm-evaluator; do
437 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
444 %dir %{_sysconfdir}/ceilometer
445 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
446 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
447 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
448 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
449 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
450 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
452 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
453 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
455 %{_bindir}/ceilometer-dbsync
456 %{_bindir}/ceilometer-expirer
457 %{_bindir}/ceilometer-send-sample
460 %defattr(-, ceilometer, ceilometer, -)
461 %dir %{_sharedstatedir}/ceilometer
462 %dir %{_sharedstatedir}/ceilometer/tmp
465 %files -n python-ceilometer
466 %{python_sitelib}/ceilometer
467 %{python_sitelib}/ceilometer-%{version}*.egg-info
477 %{_bindir}/ceilometer-agent-compute
478 %{_initrddir}/%{name}-compute
479 %{_datarootdir}/ceilometer/%{name}-compute.upstart
483 %{_bindir}/ceilometer-collector*
484 %{_bindir}/ceilometer-agent-notification
485 %{_initrddir}/%{name}-collector
486 %{_initrddir}/%{name}-notification
487 %{_datarootdir}/ceilometer/%{name}-collector.upstart
488 %{_datarootdir}/ceilometer/%{name}-notification.upstart
492 %doc ceilometer/api/v1/static/LICENSE.*
493 %{_bindir}/ceilometer-api
494 %{_initrddir}/%{name}-api
495 %{_datarootdir}/ceilometer/%{name}-api.upstart
499 %{_bindir}/ceilometer-agent-central
500 %{_initrddir}/%{name}-central
501 %{_datarootdir}/ceilometer/%{name}-central.upstart
505 %{_bindir}/ceilometer-alarm-notifier
506 %{_bindir}/ceilometer-alarm-evaluator
507 %{_initrddir}/%{name}-alarm-notifier
508 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
509 %{_initrddir}/%{name}-alarm-evaluator
510 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
514 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
515 - Update to upstream 2014.1.rc1
517 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
518 - Update to Icehouse milestone 3
520 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
521 - Fix missing dependency on python-babel
523 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
524 - Update to Icehouse milestone 2
526 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
527 - Set python-six min version to ensure updated
529 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
530 - Update to Icehouse milestone 1
532 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
533 - Update to Havana stable release 2013.2.1
535 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
536 - Update to Havana release
538 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
539 - Update to Havana rc2
540 - openstack-ceilometer-alarm now depends on python-ceilometerclient
542 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
543 - Update to Havana rc1
544 - Separate out the new alarm services to the 'alarm' subpackage
546 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
547 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
549 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
550 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
552 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
553 - Depend on python-alembic
555 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
556 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
558 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
559 - Update to Havana milestone 3
561 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
562 - Avoid python runtime dependency management
564 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
565 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
567 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
568 - Fix uninstall for openstack-ceilometer-central
570 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
573 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
576 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3