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: ceilometer-%{version}.tar.gz
14 Source1: %{pypi_name}.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
27 # patches_base=2013.1.2
29 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
30 Patch0002: 0002-avoid-code-path-causing-qpid-exchange-leaks.patch
32 # This is EL6 specific and not upstream
33 Patch100: openstack-ceilometer-newdeps.patch
36 BuildRequires: intltool
37 BuildRequires: python-sphinx10
38 BuildRequires: python-setuptools
39 BuildRequires: python2-devel
41 BuildRequires: openstack-utils
43 # These are required to build due to the requirements check added
44 BuildRequires: python-sqlalchemy0.7
45 BuildRequires: python-webob1.2
49 OpenStack ceilometer provides services to measure and
50 collect metrics from OpenStack components.
53 %package -n python-ceilometer
54 Summary: OpenStack ceilometer python libraries
55 Group: Applications/System
58 Requires: python-kombu
59 Requires: python-amqplib
61 Requires: python-eventlet
62 Requires: python-greenlet
63 Requires: python-iso8601
65 Requires: python-anyjson
66 Requires: python-stevedore
68 Requires: python-sqlalchemy0.7
69 Requires: python-migrate
71 Requires: python-webob >= 1.2
72 Requires: python-oslo-config
75 %description -n python-ceilometer
76 OpenStack ceilometer provides services to measure and
77 collect metrics from OpenStack components.
79 This package contains the ceilometer python library.
83 Summary: Components common to all OpenStack ceilometer services
84 Group: Applications/System
86 Requires: python-ceilometer = %{version}-%{release}
87 Requires: openstack-utils
89 Requires(post): chkconfig
90 Requires(postun): initscripts
91 Requires(preun): chkconfig
92 Requires(pre): shadow-utils
97 OpenStack ceilometer provides services to measure and
98 collect metrics from OpenStack components.
100 This package contains components common to all OpenStack
105 Summary: OpenStack ceilometer compute agent
106 Group: Applications/System
108 Requires: %{name}-common = %{version}-%{release}
110 Requires: python-novaclient
111 Requires: python-keystoneclient
112 Requires: libvirt-python
115 OpenStack ceilometer provides services to measure and
116 collect metrics from OpenStack components.
118 This package contains the ceilometer agent for
119 running on OpenStack compute nodes.
123 Summary: OpenStack ceilometer central agent
124 Group: Applications/System
126 Requires: %{name}-common = %{version}-%{release}
128 Requires: python-novaclient
129 Requires: python-keystoneclient
130 Requires: python-glanceclient
131 Requires: python-swiftclient
134 OpenStack ceilometer provides services to measure and
135 collect metrics from OpenStack components.
137 This package contains the central ceilometer agent.
141 Summary: OpenStack ceilometer collector agent
142 Group: Applications/System
144 Requires: %{name}-common = %{version}-%{release}
148 %description collector
149 OpenStack ceilometer provides services to measure and
150 collect metrics from OpenStack components.
152 This package contains the ceilometer collector agent.
156 Summary: OpenStack ceilometer API service
157 Group: Applications/System
159 Requires: %{name}-common = %{version}-%{release}
162 Requires: python-flask
163 Requires: python-pecan
164 Requires: python-wsme
167 OpenStack ceilometer provides services to measure and
168 collect metrics from OpenStack components.
170 This package contains the ceilometer API service.
175 Summary: Documentation for OpenStack ceilometer
178 # Required to build module documents
179 BuildRequires: python-eventlet
180 BuildRequires: python-sqlalchemy0.7
181 BuildRequires: python-webob
182 # while not strictly required, quiets the build down when building docs.
183 BuildRequires: python-migrate, python-iso8601
186 OpenStack ceilometer provides services to measure and
187 collect metrics from OpenStack components.
189 This package contains documentation files for ceilometer.
193 %setup -q -n ceilometer-%{version}
201 find . \( -name .gitignore -o -name .placeholder \) -delete
203 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
205 # TODO: Have the following handle multi line entries
206 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
209 %{__python} setup.py build
212 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
214 # docs generation requires everything to be installed first
215 export PYTHONPATH="$( pwd ):$PYTHONPATH"
220 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
221 # Fix hidden-file-or-dir warnings
222 rm -fr build/html/.doctrees build/html/.buildinfo
228 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
229 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
230 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
232 # Install config files
233 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
234 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
235 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
236 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
237 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
239 # Install initscripts for services
240 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
241 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
242 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
243 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
245 # Install upstart jobs examples
246 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
247 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
248 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
249 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
250 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
253 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
255 # Install pid directory
256 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
258 # Remove unneeded in production stuff
259 rm -f %{buildroot}%{_bindir}/ceilometer-debug
260 rm -fr %{buildroot}%{python_sitelib}/tests/
261 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
262 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
263 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
267 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
268 if ! getent passwd ceilometer >/dev/null; then
269 # Id reservation request: https://bugzilla.redhat.com/923891
270 useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
275 if [ $1 -eq 1 ] ; then
276 # Initial installation
277 /sbin/chkconfig --add %{name}-compute
281 if [ $1 -eq 1 ] ; then
282 # Initial installation
283 /sbin/chkconfig --add %{name}-collector
287 if [ $1 -eq 1 ] ; then
288 # Initial installation
289 /sbin/chkconfig --add %{name}-api
293 if [ $1 -eq 1 ] ; then
294 # Initial installation
295 /sbin/chkconfig --add %{name}-central
299 if [ $1 -eq 0 ] ; then
300 for svc in compute; do
301 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
302 /sbin/chkconfig --del %{name}-${svc}
307 if [ $1 -eq 0 ] ; then
308 for svc in collector; do
309 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
310 /sbin/chkconfig --del %{name}-${svc}
315 if [ $1 -eq 0 ] ; then
317 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
318 /sbin/chkconfig --del %{name}-${svc}
323 if [ $1 -eq 0 ] ; then
324 for svc in central; do
325 /sbin/service %{name}-${svc} stop > /dev/null 2>&1
326 /sbin/chkconfig --del %{name}-${svc}
331 if [ $1 -ge 1 ] ; then
332 # Package upgrade, not uninstall
333 for svc in compute; do
334 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
339 if [ $1 -ge 1 ] ; then
340 # Package upgrade, not uninstall
341 for svc in collector; do
342 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
347 if [ $1 -ge 1 ] ; then
348 # Package upgrade, not uninstall
350 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
355 if [ $1 -ge 1 ] ; then
356 # Package upgrade, not uninstall
357 for svc in central; do
358 /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
365 %dir %{_sysconfdir}/ceilometer
366 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
367 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
368 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
369 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
370 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
372 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
373 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
375 %{_bindir}/ceilometer-*
377 %defattr(-, ceilometer, ceilometer, -)
378 %dir %{_sharedstatedir}/ceilometer
379 %dir %{_sharedstatedir}/ceilometer/tmp
382 %files -n python-ceilometer
383 %{python_sitelib}/ceilometer
384 %{python_sitelib}/ceilometer-%{version}*.egg-info
394 %{_bindir}/ceilometer-agent-compute
395 %{_initrddir}/%{name}-compute
396 %{_datarootdir}/ceilometer/%{name}-compute.upstart
400 %{_bindir}/ceilometer-collector
401 %{_initrddir}/%{name}-collector
402 %{_datarootdir}/ceilometer/%{name}-collector.upstart
406 %doc ceilometer/api/v1/static/LICENSE.*
407 %{_bindir}/ceilometer-api
408 %{_initrddir}/%{name}-api
409 %{_datarootdir}/ceilometer/%{name}-api.upstart
413 %{_bindir}/ceilometer-agent-central
414 %{_initrddir}/%{name}-central
415 %{_datarootdir}/ceilometer/%{name}-central.upstart
419 * Fri Jun 21 2013 Pádraig Brady <P@draigBrady.com> - 2013.1.2-2
420 - Avoid qpid exchange leaks
422 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.1.2-1
423 - Update to stable/grizzly release 2013.1.2
425 * Thu Jun 6 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-3
426 - Fix uninstall for openstack-ceilometer-central
428 * Mon Apr 8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
431 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3