Update specs to v. 2014.1.rc
[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.6.rc1%{?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}.rc1.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.rc1
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-babel
69 Requires:         python-eventlet
70 Requires:         python-greenlet
71 Requires:         python-iso8601
72 Requires:         python-lxml
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
78 Requires:         PyYAML
79
80 Requires:         python-sqlalchemy0.7
81 Requires:         python-alembic
82 Requires:         python-migrate
83
84 Requires:         python-webob >= 1.2
85
86 Requires:         python-oslo-config >= 1:1.2.0
87
88 Requires:         pysnmp
89 Requires:         pytz
90 Requires:         python-croniter
91
92 %description -n   python-ceilometer
93 OpenStack ceilometer provides services to measure and
94 collect metrics from OpenStack components.
95
96 This package contains the ceilometer python library.
97
98
99 %package common
100 Summary:          Components common to all OpenStack ceilometer services
101 Group:            Applications/System
102
103 Requires:         python-ceilometer = %{version}-%{release}
104 Requires:         openstack-utils
105
106 Requires(post):   chkconfig
107 Requires(postun): initscripts
108 Requires(preun):  chkconfig
109 Requires(pre):    shadow-utils
110
111
112
113 %description common
114 OpenStack ceilometer provides services to measure and
115 collect metrics from OpenStack components.
116
117 This package contains components common to all OpenStack
118 ceilometer services.
119
120
121 %package compute
122 Summary:          OpenStack ceilometer compute agent
123 Group:            Applications/System
124
125 Requires:         %{name}-common = %{version}-%{release}
126
127 Requires:         python-novaclient
128 Requires:         python-keystoneclient
129 Requires:         libvirt-python
130
131 %description compute
132 OpenStack ceilometer provides services to measure and
133 collect metrics from OpenStack components.
134
135 This package contains the ceilometer agent for
136 running on OpenStack compute nodes.
137
138
139 %package central
140 Summary:          OpenStack ceilometer central agent
141 Group:            Applications/System
142
143 Requires:         %{name}-common = %{version}-%{release}
144
145 Requires:         python-novaclient
146 Requires:         python-keystoneclient
147 Requires:         python-glanceclient
148 Requires:         python-swiftclient
149
150 %description central
151 OpenStack ceilometer provides services to measure and
152 collect metrics from OpenStack components.
153
154 This package contains the central ceilometer agent.
155
156
157 %package collector
158 Summary:          OpenStack ceilometer collector agent
159 Group:            Applications/System
160
161 Requires:         %{name}-common = %{version}-%{release}
162
163 Requires:         python-pymongo
164
165 %description collector
166 OpenStack ceilometer provides services to measure and
167 collect metrics from OpenStack components.
168
169 This package contains the ceilometer collector agent.
170
171
172 %package api
173 Summary:          OpenStack ceilometer API service
174 Group:            Applications/System
175
176 Requires:         %{name}-common = %{version}-%{release}
177
178 Requires:         python-pymongo
179 Requires:         python-flask
180 Requires:         python-pecan >= 0.4.5
181 Requires:         python-wsme >= 0.6
182
183 %description api
184 OpenStack ceilometer provides services to measure and
185 collect metrics from OpenStack components.
186
187 This package contains the ceilometer API service.
188
189
190 %package alarm
191 Summary:          OpenStack ceilometer alarm services
192 Group:            Applications/System
193
194 Requires:         %{name}-common = %{version}-%{release}
195 Requires:         python-ceilometerclient
196
197 %description alarm
198 OpenStack ceilometer provides services to measure and
199 collect metrics from OpenStack components.
200
201 This package contains the ceilometer alarm notification
202 and evaluation services.
203
204
205 %if 0%{?with_doc}
206 %package doc
207 Summary:          Documentation for OpenStack ceilometer
208 Group:            Documentation
209
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
216
217 %description      doc
218 OpenStack ceilometer provides services to measure and
219 collect metrics from OpenStack components.
220
221 This package contains documentation files for ceilometer.
222 %endif
223
224 %prep
225 %setup -q -n ceilometer-%{version}
226
227 %patch0001 -p1
228
229 # Apply EL6 patch
230 %patch100 -p1
231
232 find . \( -name .gitignore -o -name .placeholder \) -delete
233
234 find ceilometer -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
235
236 # TODO: Have the following handle multi line entries
237 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
238
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
242
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
251 done < %{SOURCE1}
252
253 %build
254 %{__python} setup.py build
255
256 %install
257 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
258
259 # docs generation requires everything to be installed first
260 export PYTHONPATH="$( pwd ):$PYTHONPATH"
261
262 pushd doc
263
264 %if 0%{?with_doc}
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
268 %endif
269
270 popd
271
272 # Setup directories
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
276
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
284
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
293
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/
303
304 # Install logrotate
305 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
306
307 # Install pid directory
308 install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
309
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.*
316
317
318 %pre common
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
323 fi
324 exit 0
325
326 %post compute
327 if [ $1 -eq 1 ] ; then
328     # Initial installation
329     /sbin/chkconfig --add %{name}-compute
330 fi
331
332 %post collector
333 if [ $1 -eq 1 ] ; then
334     # Initial installation
335     /sbin/chkconfig --add %{name}-collector
336 fi
337
338 %post api
339 if [ $1 -eq 1 ] ; then
340     # Initial installation
341     /sbin/chkconfig --add %{name}-api
342 fi
343
344 %post central
345 if [ $1 -eq 1 ] ; then
346     # Initial installation
347     /sbin/chkconfig --add %{name}-central
348 fi
349
350 %post alarm
351 if [ $1 -eq 1 ] ; then
352     # Initial installation
353     for svc in alarm-notifier alarm-evaluator; do
354         /sbin/chkconfig --add %{name}-${svc}
355     done
356 fi
357
358 %preun compute
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}
363     done
364 fi
365
366 %preun collector
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}
371     done
372 fi
373
374 %preun api
375 if [ $1 -eq 0 ] ; then
376     for svc in api; do
377         /sbin/service %{name}-${svc} stop > /dev/null 2>&1
378         /sbin/chkconfig --del %{name}-${svc}
379     done
380 fi
381
382 %preun central
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}
387     done
388 fi
389
390 %preun alarm
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}
395     done
396 fi
397
398 %postun compute
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 || :
403     done
404 fi
405
406 %postun collector
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 || :
411     done
412 fi
413
414 %postun api
415 if [ $1 -ge 1 ] ; then
416     # Package upgrade, not uninstall
417     for svc in api; do
418         /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
419     done
420 fi
421
422 %postun central
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 || :
427     done
428 fi
429
430 %postun alarm
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 || :
436     done
437 fi
438
439
440 %files common
441 %doc LICENSE
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}
449
450 %dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
451 %dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
452
453 %{_bindir}/ceilometer-dbsync
454 %{_bindir}/ceilometer-expirer
455 %{_bindir}/ceilometer-send-sample
456
457
458 %defattr(-, ceilometer, ceilometer, -)
459 %dir %{_sharedstatedir}/ceilometer
460 %dir %{_sharedstatedir}/ceilometer/tmp
461
462
463 %files -n python-ceilometer
464 %{python_sitelib}/ceilometer
465 %{python_sitelib}/ceilometer-%{version}*.egg-info
466
467
468 %if 0%{?with_doc}
469 %files doc
470 %doc doc/build/html
471 %endif
472
473
474 %files compute
475 %{_bindir}/ceilometer-agent-compute
476 %{_initrddir}/%{name}-compute
477 %{_datarootdir}/ceilometer/%{name}-compute.upstart
478
479
480 %files collector
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
487
488
489 %files api
490 %doc ceilometer/api/v1/static/LICENSE.*
491 %{_bindir}/ceilometer-api
492 %{_initrddir}/%{name}-api
493 %{_datarootdir}/ceilometer/%{name}-api.upstart
494
495
496 %files central
497 %{_bindir}/ceilometer-agent-central
498 %{_initrddir}/%{name}-central
499 %{_datarootdir}/ceilometer/%{name}-central.upstart
500
501
502 %files alarm
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
509
510
511 %changelog
512 * Mon Mar 31 2014 Pádraig Brady <P@draigBrady.com> 2014.1-0.6.rc1
513 - Update to upstream 2014.1.rc1
514
515 * Fri Mar 14 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
516 - Update to Icehouse milestone 3
517
518 * Tue Feb 04 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.4.b2
519 - Fix missing dependency on python-babel
520
521 * Mon Jan 27 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.3.b2
522 - Update to Icehouse milestone 2
523
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
526
527 * Mon Dec 23 2013 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.1.b1
528 - Update to Icehouse milestone 1
529
530 * Tue Dec 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1
531 - Update to Havana stable release 2013.2.1
532
533 * Thu Oct 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-1
534 - Update to Havana release
535
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
539
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
543
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
546
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
549
550 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b3
551 - Depend on python-alembic
552
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
555
556 * Mon Sep 9 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.5.b3
557 - Update to Havana milestone 3
558
559 * Tue Aug 27 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b1
560 - Avoid python runtime dependency management
561
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
564
565 * Thu Jun  6 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.2.b1
566 - Fix uninstall for openstack-ceilometer-central
567
568 * Fri May 31 2013 Pádraig Brady <P@draigBrady.com> - 2013.2-0.1.b1
569 - Havana milestone 1
570
571 * Mon Apr  8 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-2
572 - Grizzly release
573
574 * Tue Mar 26 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.5.g3
575 - Initial package