Update specs to v. 2014.1.b3
[openstack-build/ceilometer-build.git] / rpm / SPECS / openstack-ceilometer.spec
1 %global _without_doc 1
2 %global with_doc %{!?_without_doc:1}%{?_without_doc:0}
3 %global pypi_name ceilometer
4
5 Name:             openstack-ceilometer
6 Version:          2014.1
7 Release:          0.3.b3%{?dist}
8 Summary:          OpenStack measurement collection service
9
10 Group:            Applications/System
11 License:          ASL 2.0
12 URL:              https://wiki.openstack.org/wiki/Ceilometer
13 Source0:          http://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.b2.tar.gz
14 Source1:          %{pypi_name}-dist.conf
15 Source2:          %{pypi_name}.logrotate
16
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
31
32 #
33 # patches_base=2014.1.b2
34 #
35 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
36
37 # This is EL6 specific and not upstream
38 Patch100:         openstack-ceilometer-newdeps.patch
39
40 BuildArch:        noarch
41 BuildRequires:    intltool
42 BuildRequires:    python-sphinx10
43 BuildRequires:    python-setuptools
44 BuildRequires:    python-pbr
45 BuildRequires:    python-d2to1
46 BuildRequires:    python2-devel
47
48 BuildRequires:    openstack-utils
49
50 # These are required to build due to the requirements check added
51 BuildRequires:    python-sqlalchemy0.7
52 BuildRequires:    python-webob1.2
53
54
55 %description
56 OpenStack ceilometer provides services to measure and
57 collect metrics from OpenStack components.
58
59
60 %package -n       python-ceilometer
61 Summary:          OpenStack ceilometer python libraries
62 Group:            Applications/System
63
64 Requires:         python-qpid
65 Requires:         python-kombu
66 Requires:         python-amqplib
67
68 Requires:         python-eventlet
69 Requires:         python-greenlet
70 Requires:         python-iso8601
71 Requires:         python-lxml
72 Requires:         python-anyjson
73 Requires:         python-jsonpath-rw
74 Requires:         python-stevedore
75 Requires:         python-msgpack
76 Requires:         python-six >= 1.4.1
77 Requires:         PyYAML
78
79 Requires:         python-sqlalchemy0.7
80 Requires:         python-alembic
81 Requires:         python-migrate
82
83 Requires:         python-webob >= 1.2
84
85 Requires:         python-oslo-config >= 1:1.2.0
86
87 %description -n   python-ceilometer
88 OpenStack ceilometer provides services to measure and
89 collect metrics from OpenStack components.
90
91 This package contains the ceilometer python library.
92
93
94 %package common
95 Summary:          Components common to all OpenStack ceilometer services
96 Group:            Applications/System
97
98 Requires:         python-ceilometer = %{version}-%{release}
99 Requires:         openstack-utils
100
101 Requires(post):   chkconfig
102 Requires(postun): initscripts
103 Requires(preun):  chkconfig
104 Requires(pre):    shadow-utils
105
106
107
108 %description common
109 OpenStack ceilometer provides services to measure and
110 collect metrics from OpenStack components.
111
112 This package contains components common to all OpenStack
113 ceilometer services.
114
115
116 %package compute
117 Summary:          OpenStack ceilometer compute agent
118 Group:            Applications/System
119
120 Requires:         %{name}-common = %{version}-%{release}
121
122 Requires:         python-novaclient
123 Requires:         python-keystoneclient
124 Requires:         libvirt-python
125
126 %description compute
127 OpenStack ceilometer provides services to measure and
128 collect metrics from OpenStack components.
129
130 This package contains the ceilometer agent for
131 running on OpenStack compute nodes.
132
133
134 %package central
135 Summary:          OpenStack ceilometer central agent
136 Group:            Applications/System
137
138 Requires:         %{name}-common = %{version}-%{release}
139
140 Requires:         python-novaclient
141 Requires:         python-keystoneclient
142 Requires:         python-glanceclient
143 Requires:         python-swiftclient
144
145 %description central
146 OpenStack ceilometer provides services to measure and
147 collect metrics from OpenStack components.
148
149 This package contains the central ceilometer agent.
150
151
152 %package collector
153 Summary:          OpenStack ceilometer collector agent
154 Group:            Applications/System
155
156 Requires:         %{name}-common = %{version}-%{release}
157
158 Requires:         python-pymongo
159
160 %description collector
161 OpenStack ceilometer provides services to measure and
162 collect metrics from OpenStack components.
163
164 This package contains the ceilometer collector agent.
165
166
167 %package api
168 Summary:          OpenStack ceilometer API service
169 Group:            Applications/System
170
171 Requires:         %{name}-common = %{version}-%{release}
172
173 Requires:         python-pymongo
174 Requires:         python-flask
175 Requires:         python-pecan
176 Requires:         python-wsme >= 0.5b6
177
178 %description api
179 OpenStack ceilometer provides services to measure and
180 collect metrics from OpenStack components.
181
182 This package contains the ceilometer API service.
183
184
185 %package alarm
186 Summary:          OpenStack ceilometer alarm services
187 Group:            Applications/System
188
189 Requires:         %{name}-common = %{version}-%{release}
190 Requires:         python-ceilometerclient
191
192 %description alarm
193 OpenStack ceilometer provides services to measure and
194 collect metrics from OpenStack components.
195
196 This package contains the ceilometer alarm notification
197 and evaluation services.
198
199
200 %if 0%{?with_doc}
201 %package doc
202 Summary:          Documentation for OpenStack ceilometer
203 Group:            Documentation
204
205 # Required to build module documents
206 BuildRequires:    python-eventlet
207 BuildRequires:    python-sqlalchemy0.7
208 BuildRequires:    python-webob
209 # while not strictly required, quiets the build down when building docs.
210 BuildRequires:    python-migrate, python-iso8601
211
212 %description      doc
213 OpenStack ceilometer provides services to measure and
214 collect metrics from OpenStack components.
215
216 This package contains documentation files for ceilometer.
217 %endif
218
219 %prep
220 %setup -q -n ceilometer-%{version}
221
222 %patch0001 -p1
223
224 # Apply EL6 patch
225 %patch100 -p1
226
227 find . \( -name .gitignore -o -name .placeholder \) -delete
228
229 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
230
231 # TODO: Have the following handle multi line entries
232 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
233
234 # Remove the requirements file so that pbr hooks don't add it
235 # to distutils requires_dist config
236 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
237
238 # Programmatically update defaults in sample config
239 # which is installed at /etc/ceilometer/ceilometer.conf
240 # TODO: Make this more robust
241 # Note it only edits the first occurance, so assumes a section ordering in sample
242 # and also doesn't support multi-valued variables.
243 while read name eq value; do
244   test "$name" && test "$value" || continue
245   sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/ceilometer/ceilometer.conf.sample
246 done < %{SOURCE1}
247
248 %build
249 %{__python} setup.py build
250
251 %install
252 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
253
254 # docs generation requires everything to be installed first
255 export PYTHONPATH="$( pwd ):$PYTHONPATH"
256
257 pushd doc
258
259 %if 0%{?with_doc}
260 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
261 # Fix hidden-file-or-dir warnings
262 rm -fr build/html/.doctrees build/html/.buildinfo
263 %endif
264
265 popd
266
267 # Setup directories
268 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
269 install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
270 install -d -m 755 %{buildroot}%{_localstatedir}/log/ceilometer
271
272 # Install config files
273 install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
274 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
275 install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
276 install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
277 install -p -D -m 640 etc/ceilometer/sources.json %{buildroot}%{_sysconfdir}/ceilometer/sources.json
278 install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
279
280 # Install initscripts for services
281 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
282 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
283 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
284 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/%{name}-central
285 install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
286 install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
287 install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
288
289 # Install upstart jobs examples
290 install -d -m 755 %{buildroot}%{_datadir}/ceilometer
291 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/ceilometer/
292 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/ceilometer/
293 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/ceilometer/
294 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/ceilometer/
295 install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
296 install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
297 install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
298
299 # Install logrotate
300 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
301
302 # Install pid directory
303 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
304
305 # Remove unneeded in production stuff
306 rm -f %{buildroot}%{_bindir}/ceilometer-debug
307 rm -fr %{buildroot}%{python_sitelib}/tests/
308 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
309 rm -f %{buildroot}/usr/share/doc/ceilometer/README*
310 rm -f %{buildroot}/%{python_sitelib}/ceilometer/api/v1/static/LICENSE.*
311
312
313 %pre common
314 getent group ceilometer >/dev/null || groupadd -r ceilometer --gid 166
315 if ! getent passwd ceilometer >/dev/null; then
316   # Id reservation request: https://bugzilla.redhat.com/923891
317   useradd -u 166 -r -g ceilometer -G ceilometer,nobody -d %{_sharedstatedir}/ceilometer -s /sbin/nologin -c "OpenStack ceilometer Daemons" ceilometer
318 fi
319 exit 0
320
321 %post compute
322 if [ $1 -eq 1 ] ; then
323     # Initial installation
324     /sbin/chkconfig --add %{name}-compute
325 fi
326
327 %post collector
328 if [ $1 -eq 1 ] ; then
329     # Initial installation
330     /sbin/chkconfig --add %{name}-collector
331 fi
332
333 %post api
334 if [ $1 -eq 1 ] ; then
335     # Initial installation
336     /sbin/chkconfig --add %{name}-api
337 fi
338
339 %post central
340 if [ $1 -eq 1 ] ; then
341     # Initial installation
342     /sbin/chkconfig --add %{name}-central
343 fi
344
345 %post alarm
346 if [ $1 -eq 1 ] ; then
347     # Initial installation
348     for svc in alarm-notifier alarm-evaluator; do
349         /sbin/chkconfig --add %{name}-${svc}
350     done
351 fi
352
353 %preun compute
354 if [ $1 -eq 0 ] ; then
355     for svc in compute; do
356         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
357         /sbin/chkconfig --del %{name}-${svc}
358     done
359 fi
360
361 %preun collector
362 if [ $1 -eq 0 ] ; then
363     for svc in collector notification; do
364         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
365         /sbin/chkconfig --del %{name}-${svc}
366     done
367 fi
368
369 %preun api
370 if [ $1 -eq 0 ] ; then
371     for svc in api; do
372         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
373         /sbin/chkconfig --del %{name}-${svc}
374     done
375 fi
376
377 %preun central
378 if [ $1 -eq 0 ] ; then
379     for svc in central; do
380         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
381         /sbin/chkconfig --del %{name}-${svc}
382     done
383 fi
384
385 %preun alarm
386 if [ $1 -eq 0 ] ; then
387     for svc in alarm-notifier alarm-evaluator; do
388         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
389         /sbin/chkconfig --del %{name}-${svc}
390     done
391 fi
392
393 %postun compute
394 if [ $1 -ge 1 ] ; then
395     # Package upgrade, not uninstall
396     for svc in compute; do
397         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
398     done
399 fi
400
401 %postun collector
402 if [ $1 -ge 1 ] ; then
403     # Package upgrade, not uninstall
404     for svc in collector notification; do
405         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
406     done
407 fi
408
409 %postun api
410 if [ $1 -ge 1 ] ; then
411     # Package upgrade, not uninstall
412     for svc in api; do
413         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
414     done
415 fi
416
417 %postun central
418 if [ $1 -ge 1 ] ; then
419     # Package upgrade, not uninstall
420     for svc in central; do
421         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
422     done
423 fi
424
425 %postun alarm
426 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
427 if [ $1 -ge 1 ] ; then
428     # Package upgrade, not uninstall
429     for svc in alarm-notifier alarm-evaluator; do
430         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
431     done
432 fi
433
434
435 %files common
436 %doc LICENSE
437 %dir %{_sysconfdir}/ceilometer
438 %attr(-, root, ceilometer) %{_datadir}/ceilometer/ceilometer-dist.conf
439 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/ceilometer.conf
440 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/policy.json
441 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/sources.json
442 %config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/pipeline.yaml
443 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
444
445 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
446 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
447
448 %{_bindir}/ceilometer-dbsync
449 %{_bindir}/ceilometer-expirer
450 %{_bindir}/ceilometer-send-sample
451
452
453 %defattr(-, ceilometer, ceilometer, -)
454 %dir %{_sharedstatedir}/ceilometer
455 %dir %{_sharedstatedir}/ceilometer/tmp
456
457
458 %files -n python-ceilometer
459 %{python_sitelib}/ceilometer
460 %{python_sitelib}/ceilometer-%{version}*.egg-info
461
462
463 %if 0%{?with_doc}
464 %files doc
465 %doc doc/build/html
466 %endif
467
468
469 %files compute
470 %{_bindir}/ceilometer-agent-compute
471 %{_initrddir}/%{name}-compute
472 %{_datarootdir}/ceilometer/%{name}-compute.upstart
473
474
475 %files collector
476 %{_bindir}/ceilometer-collector*
477 %{_bindir}/ceilometer-agent-notification
478 %{_initrddir}/%{name}-collector
479 %{_initrddir}/%{name}-notification
480 %{_datarootdir}/ceilometer/%{name}-collector.upstart
481 %{_datarootdir}/ceilometer/%{name}-notification.upstart
482
483
484 %files api
485 %doc ceilometer/api/v1/static/LICENSE.*
486 %{_bindir}/ceilometer-api
487 %{_initrddir}/%{name}-api
488 %{_datarootdir}/ceilometer/%{name}-api.upstart
489
490
491 %files central
492 %{_bindir}/ceilometer-agent-central
493 %{_initrddir}/%{name}-central
494 %{_datarootdir}/ceilometer/%{name}-central.upstart
495
496
497 %files alarm
498 %{_bindir}/ceilometer-alarm-notifier
499 %{_bindir}/ceilometer-alarm-evaluator
500 %{_initrddir}/%{name}-alarm-notifier
501 %{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
502 %{_initrddir}/%{name}-alarm-evaluator
503 %{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
504
505
506 %changelog
507 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
508 - Update to Icehouse milestone 2
509
510 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
511 - Set python-six min version to ensure updated
512
513 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
514 - Update to Icehouse milestone 1
515
516 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
517 - Update to Havana stable release 2013.2.1
518
519 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
520 - Update to Havana release
521
522 * Tue Oct 15 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc2
523 - Update to Havana rc2
524 - openstack-ceilometer-alarm now depends on python-ceilometerclient
525
526 * Thu Oct 03 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.12.rc1
527 - Update to Havana rc1
528 - Separate out the new alarm services to the 'alarm' subpackage
529
530 * Fri Sep 13 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.10.b3
531 - Depend on python-oslo-config >= 1:1.2.0 so it upgraded automatically
532
533 * Mon Sep 10 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.8.b3
534 - Depend on python-pymongo rather than pymongo to avoid a puppet bug
535
536 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
537 - Depend on python-alembic
538
539 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.6.b3
540 - Distribute dist defaults in ceilometer-dist.conf separate to user ceilometer.conf
541
542 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
543 - Update to Havana milestone 3
544
545 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
546 - Avoid python runtime dependency management
547
548 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.3.b1
549 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
550
551 * Thu Jun  6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
552 - Fix uninstall for openstack-ceilometer-central
553
554 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
555 - Havana milestone 1
556
557 * Mon Apr  8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
558 - Grizzly release
559
560 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3
561 - Initial package