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
31 # patches_base=2013.2.3
33 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
35 # This is EL6 specific and not upstream
36 Patch100: openstack-ceilometer-newdeps.patch
39 BuildRequires: intltool
40 BuildRequires: python-sphinx10
41 BuildRequires: python-setuptools
42 BuildRequires: python-pbr
43 BuildRequires: python-d2to1
44 BuildRequires: python2-devel
46 BuildRequires: openstack-utils
48 # These are required to build due to the requirements check added
49 BuildRequires: python-sqlalchemy0.7
50 BuildRequires: python-webob1.2
54 OpenStack ceilometer provides services to measure and
55 collect metrics from OpenStack components.
58 %package -n python-ceilometer
59 Summary: OpenStack ceilometer python libraries
60 Group: Applications/System
63 Requires: python-kombu
64 Requires: python-amqplib
66 Requires: python-babel
67 Requires: python-eventlet
68 Requires: python-greenlet
69 Requires: python-iso8601
71 Requires: python-anyjson
72 Requires: python-stevedore
73 Requires: python-msgpack
74 Requires: python-netaddr
78 Requires: python-sqlalchemy0.7
79 Requires: python-alembic
80 Requires: python-migrate
82 Requires: python-webob >= 1.2
84 Requires: python-oslo-config >= 1:1.2.0
86 %description -n python-ceilometer
87 OpenStack ceilometer provides services to measure and
88 collect metrics from OpenStack components.
90 This package contains the ceilometer python library.
94 Summary: Components common to all OpenStack ceilometer services
95 Group: Applications/System
97 Requires: python-ceilometer = %{version}-%{release}
98 Requires: openstack-utils
100 Requires(post): chkconfig
101 Requires(postun): initscripts
102 Requires(preun): chkconfig
103 Requires(pre): shadow-utils
108 OpenStack ceilometer provides services to measure and
109 collect metrics from OpenStack components.
111 This package contains components common to all OpenStack
116 Summary: OpenStack ceilometer compute agent
117 Group: Applications/System
119 Requires: %{name}-common = %{version}-%{release}
121 Requires: python-novaclient
122 Requires: python-keystoneclient
123 Requires: libvirt-python
126 OpenStack ceilometer provides services to measure and
127 collect metrics from OpenStack components.
129 This package contains the ceilometer agent for
130 running on OpenStack compute nodes.
134 Summary: OpenStack ceilometer central agent
135 Group: Applications/System
137 Requires: %{name}-common = %{version}-%{release}
139 Requires: python-novaclient
140 Requires: python-keystoneclient
141 Requires: python-glanceclient
142 Requires: python-swiftclient
145 OpenStack ceilometer provides services to measure and
146 collect metrics from OpenStack components.
148 This package contains the central ceilometer agent.
152 Summary: OpenStack ceilometer collector agent
153 Group: Applications/System
155 Requires: %{name}-common = %{version}-%{release}
157 Requires: python-pymongo
159 %description collector
160 OpenStack ceilometer provides services to measure and
161 collect metrics from OpenStack components.
163 This package contains the ceilometer collector agent.
167 Summary: OpenStack ceilometer API service
168 Group: Applications/System
170 Requires: %{name}-common = %{version}-%{release}
172 Requires: python-pymongo
173 Requires: python-flask
174 Requires: python-pecan
175 Requires: python-wsme
178 OpenStack ceilometer provides services to measure and
179 collect metrics from OpenStack components.
181 This package contains the ceilometer API service.
185 Summary: OpenStack ceilometer alarm services
186 Group: Applications/System
188 Requires: %{name}-common = %{version}-%{release}
189 Requires: python-ceilometerclient
192 OpenStack ceilometer provides services to measure and
193 collect metrics from OpenStack components.
195 This package contains the ceilometer alarm notification
196 and evaluation services.
201 Summary: Documentation for OpenStack ceilometer
204 # Required to build module documents
205 BuildRequires: python-eventlet
206 BuildRequires: python-sqlalchemy0.7
207 BuildRequires: python-webob
208 # while not strictly required, quiets the build down when building docs.
209 BuildRequires: python-migrate, python-iso8601
212 OpenStack ceilometer provides services to measure and
213 collect metrics from OpenStack components.
215 This package contains documentation files for ceilometer.
219 %setup -q -n ceilometer-%{version}
226 find . \( -name .gitignore -o -name .placeholder \) -delete
228 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
230 # TODO: Have the following handle multi line entries
231 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
233 # Remove the requirements file so that pbr hooks don't add it
234 # to distutils requires_dist config
235 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
237 # Programmatically update defaults in sample config
238 # which is installed at /etc/ceilometer/ceilometer.conf
239 # TODO: Make this more robust
240 # Note it only edits the first occurance, so assumes a section ordering in sample
241 # and also doesn't support multi-valued variables.
242 while read name eq value; do
243 test "$name" && test "$value" || continue
244 sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
248 %{__python} setup.py build
251 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
253 # docs generation requires everything to be installed first
254 export PYTHONPATH="$( pwd ):$PYTHONPATH"
259 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
260 # Fix hidden-file-or-dir warnings
261 rm -fr build/html/.doctrees build/html/.buildinfo
267 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
268 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
269 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
271 # Install config files
272 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
273 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
274 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
275 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
276 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
277 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
279 # Install initscripts for services
280 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
281 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
282 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
283 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
284 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
285 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
287 # Install upstart jobs examples
288 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
289 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
290 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
291 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
292 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
293 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
294 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
297 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
299 # Install pid directory
300 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
302 # Remove unneeded in production stuff
303 rm -f %{buildroot}%{_bindir}/ceilometer-debug
304 rm -fr %{buildroot}%{python_sitelib}/tests/
305 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
306 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
307 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
311 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
312 if ! getent passwd ceilometer >/dev/null; then
313 # Id reservation request: https://bugzilla.redhat.com/923891
314 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
319 if [ $1 -eq 1 ] ; then
320 # Initial installation
321 /sbin/chkconfig --add %{name}-compute
325 if [ $1 -eq 1 ] ; then
326 # Initial installation
327 /sbin/chkconfig --add %{name}-collector
331 if [ $1 -eq 1 ] ; then
332 # Initial installation
333 /sbin/chkconfig --add %{name}-api
337 if [ $1 -eq 1 ] ; then
338 # Initial installation
339 /sbin/chkconfig --add %{name}-central
343 if [ $1 -eq 1 ] ; then
344 # Initial installation
345 for svc in alarm-notifier alarm-evaluator; do
346 /sbin/chkconfig --add %{name}-${svc}
351 if [ $1 -eq 0 ] ; then
352 for svc in compute; do
353 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
354 /sbin/chkconfig --del %{name}-${svc}
359 if [ $1 -eq 0 ] ; then
360 for svc in collector; do
361 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
362 /sbin/chkconfig --del %{name}-${svc}
367 if [ $1 -eq 0 ] ; then
369 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
370 /sbin/chkconfig --del %{name}-${svc}
375 if [ $1 -eq 0 ] ; then
376 for svc in central; do
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 alarm-notifier alarm-evaluator; do
385 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
386 /sbin/chkconfig --del %{name}-${svc}
391 if [ $1 -ge 1 ] ; then
392 # Package upgrade, not uninstall
393 for svc in compute; do
394 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
399 if [ $1 -ge 1 ] ; then
400 # Package upgrade, not uninstall
401 for svc in collector; do
402 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
407 if [ $1 -ge 1 ] ; then
408 # Package upgrade, not uninstall
410 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
415 if [ $1 -ge 1 ] ; then
416 # Package upgrade, not uninstall
417 for svc in central; do
418 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
423 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
424 if [ $1 -ge 1 ] ; then
425 # Package upgrade, not uninstall
426 for svc in alarm-notifier alarm-evaluator; do
427 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
434 %dir %{_sysconfdir}/ceilometer
435 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
436 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
437 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
438 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
439 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
440 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
442 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
443 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
445 %{_bindir}/ceilometer-dbsync
446 %{_bindir}/ceilometer-expirer
449 %defattr(-, ceilometer, ceilometer, -)
450 %dir %{_sharedstatedir}/ceilometer
451 %dir %{_sharedstatedir}/ceilometer/tmp
454 %files -n python-ceilometer
455 %{python_sitelib}/ceilometer
456 %{python_sitelib}/ceilometer-%{version}*.egg-info
466 %{_bindir}/ceilometer-agent-compute
467 %{_initrddir}/%{name}-compute
468 %{_datarootdir}/ceilometer/%{name}-compute.upstart
472 %{_bindir}/ceilometer-collector*
473 %{_initrddir}/%{name}-collector
474 %{_datarootdir}/ceilometer/%{name}-collector.upstart
478 %doc ceilometer/api/v1/static/LICENSE.*
479 %{_bindir}/ceilometer-api
480 %{_initrddir}/%{name}-api
481 %{_datarootdir}/ceilometer/%{name}-api.upstart
485 %{_bindir}/ceilometer-agent-central
486 %{_initrddir}/%{name}-central
487 %{_datarootdir}/ceilometer/%{name}-central.upstart
491 %{_bindir}/ceilometer-alarm-notifier
492 %{_bindir}/ceilometer-alarm-evaluator
493 %{_initrddir}/%{name}-alarm-notifier
494 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
495 %{_initrddir}/%{name}-alarm-evaluator
496 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
500 * Thu Apr 10 2014 Pádraig Brady <pbrady@redhat.com> - 2013.2.3-1
501 - Update to Havana stable release 2013.2.3
503 * Fri Feb 14 2014 Matthias Runge <mrunge@redhat.com> - 2014.2.2-1
504 - Update to havana stable release 2013.2.2
506 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-2
507 - Fix missing dependency on python-babel
509 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
510 - Update to Havana stable release 2013.2.1
512 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
513 - Update to Havana release
515 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
516 - Update to Havana rc2
517 - openstack-ceilometer-alarm now depends on python-ceilometerclient
519 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
520 - Update to Havana rc1
521 - Separate out the new alarm services to the 'alarm' subpackage
523 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
524 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
526 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
527 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
529 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
530 - Depend on python-alembic
532 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
533 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
535 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
536 - Update to Havana milestone 3
538 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
539 - Avoid python runtime dependency management
541 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
542 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
544 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
545 - Fix uninstall for openstack-ceilometer-central
547 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
550 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
553 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3