Update after bug:1515255
[openstack-build/cinder-build.git] / centos7 / rpm / SPECS / openstack-cinder.spec
1 %global with_doc %{!?_without_doc:1}%{?_without_doc:0}
2
3 Name:             openstack-cinder
4 Epoch:            1
5 Version:          7.0.0.0rc1
6 Release:          2%{?dist}~mos8.0.1
7 Summary:          OpenStack Volume service
8
9 Group:            Applications/System
10 License:          ASL 2.0
11 URL:              http://www.openstack.org/software/openstack-storage/
12 Source0:          cinder-%{version}.tar.gz
13 Source1:          cinder-dist.conf
14 Source2:          cinder.logrotate
15 Source3:          cinder-tgt.conf
16
17 Source10:         openstack-cinder-api.init
18 Source11:         openstack-cinder-scheduler.init
19 Source12:         openstack-cinder-volume.init
20 Source13:         openstack-cinder-backup.init
21 Source14:         cinder.conf.sample
22
23 Source30:         openstack-cinder-api.service
24 Source31:         openstack-cinder-scheduler.service
25 Source32:         openstack-cinder-volume.service
26 Source33:         openstack-cinder-backup.service
27
28
29 Source20:         cinder-sudoers
30
31 #
32 # patches_base=2014.1.1
33 #
34 Patch0001: 0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch
35
36 BuildArch:        noarch
37 BuildRequires:    intltool
38 BuildRequires:    python-d2to1
39 BuildRequires:    python-oslo-sphinx
40 BuildRequires:    python-pbr
41 BuildRequires:    python-sphinx
42 BuildRequires:    python-setuptools
43 BuildRequires:    python-netaddr >= 0.7.12
44 BuildRequires:    python-stevedore
45
46 #Requires:         openstack-utils
47 Requires:         python-cinder = 1:%{version}-%{release}
48
49 # as convenience
50 Requires:         python-cinderclient
51
52 Requires(post):   chkconfig
53 Requires(postun): initscripts
54 Requires(preun):  chkconfig
55 Requires(pre):    shadow-utils
56
57 Requires:         lvm2
58 #Requires:         scsi-target-utils
59 Requires:          iscsi-initiator-utils
60
61 %description
62 OpenStack Volume (codename Cinder) provides services to manage and
63 access block storage volumes for use by Virtual Machine instances.
64
65
66 %package -n       python-cinder
67 Summary:          OpenStack Volume Python libraries
68 Group:            Applications/System
69
70 Requires:         sudo
71
72 Requires:         MySQL-python
73
74 Requires:         qemu-img
75 Requires:         sysfsutils
76
77 Requires:         python-pbr >= 1.6
78 Requires:         python-anyjson >= 0.3.3
79 Requires:         python-argparse
80 Requires:         python-babel >= 1.3
81 Requires:         python-enum34
82 Requires:         python-eventlet >= 0.17.4
83 Requires:         python-greenlet >= 0.3.2
84 Requires:         python-iso8601 >= 0.1.9
85 Requires:         python-keystoneclient >= 1:1.6.0
86 Requires:         python-keystonemiddleware >= 2.0.0
87 Requires:         python-kombu >= 3.0.7
88 Requires:         python-lxml >= 2.3
89 Requires:         python-netaddr >= 0.7.12
90 Requires:         python-oslo-config >= 1:2.3.0
91 Requires:         python-oslo-concurrency >= 2.3.0
92 Requires:         python-oslo-context >= 0.2.0
93 Requires:         python-oslo-db >= 2.4.1
94 Requires:         python-oslo-log >= 1.8.0
95 Requires:         python-oslo-messaging >= 1.16.0
96 Requires:         python-oslo-middleware >= 2.8.0
97 Requires:         python-oslo-policy >= 0.5.0
98 Requires:         python-oslo-reports >= 0.1.0
99 Requires:         python-oslo-rootwrap >= 2.0.0
100 Requires:         python-oslo-serialization >= 1.4.0
101 Requires:         python-oslo-utils >= 2.0.0
102 Requires:         python-oslo-versionedobjects >= 0.9.0
103 Requires:         python-osprofiler >= 0.3.0
104 Requires:         python-paramiko >= 1.13.0
105 Requires:         python-paste
106 Requires:         python-paste-deploy >= 1.5.0
107 Requires:         python-crypto >= 2.6
108 Requires:         pyparsing >= 2.0.3
109 Requires:         python-barbicanclient >= 3.3.0
110 Requires:         python-glanceclient >= 1:0.18.0
111 Requires:         python-novaclient >= 1:2.28.0
112 Requires:         python-swiftclient >= 2.2.0
113 Requires:         python-requests >= 2.5.2
114 Requires:         python-retrying >= 1.2.3
115 Requires:         python-routes >= 1.12.3
116 Requires:         python-taskflow >= 1.16
117 Requires:         python-rtslib >= 2.1.fb41
118 Requires:         python-six >= 1.9.0
119 Requires:         python-sqlalchemy  >= 0.9.9
120 Requires:         python-migrate >= 0.9.6
121 Requires:         python-stevedore >= 1.5.0
122 Requires:         python-suds-jurko >= 0.6
123 Requires:         python-webob >= 1.2.3
124 Requires:         python-oslo-i18n >= 1.5.0
125 Requires:         python-oslo-vmware >= 1.16.0
126
127 Requires:         os-brick >= 0.4.0
128
129 #Requires:         python-qpid
130 #Requires:         python-amqplib
131 #Requires:         python-lockfile
132 #Requires:         python-ceph
133 #Requires:         iscsi-initiator-utils
134
135 %description -n   python-cinder
136 OpenStack Volume (codename Cinder) provides services to manage and
137 access block storage volumes for use by Virtual Machine instances.
138
139 This package contains the cinder Python library.
140
141 %if 0%{?with_doc}
142 %package doc
143 Summary:          Documentation for OpenStack Volume
144 Group:            Documentation
145
146 Requires:         %{name} = 1:%{version}-%{release}
147
148 BuildRequires:    graphviz
149
150 # Required to build module documents
151 BuildRequires:    python-eventlet
152 BuildRequires:    python-routes
153 BuildRequires:    python-sqlalchemy
154 BuildRequires:    python-webob
155 # while not strictly required, quiets the build down when building docs.
156 BuildRequires:    python-migrate, python-iso8601
157
158 %description      doc
159 OpenStack Volume (codename Cinder) provides services to manage and
160 access block storage volumes for use by Virtual Machine instances.
161
162 This package contains documentation files for cinder.
163 %endif
164
165 %prep
166 %setup -q -n cinder-%{version}
167
168 %patch0001 -p1
169
170 find . \( -name .gitignore -o -name .placeholder \) -delete
171
172 find cinder -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
173
174 # TODO: Have the following handle multi line entries
175 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
176
177 # Remove the requirements file so that pbr hooks don't add it
178 # to distutils requires_dist config
179 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
180
181 # We add REDHATCINDERVERSION/RELEASE with the pbr removal patch
182 sed -i s/REDHATCINDERVERSION/%{version}/ cinder/version.py
183 sed -i s/REDHATCINDERRELEASE/%{release}/ cinder/version.py
184
185 %build
186 %{__python} setup.py build
187
188 %install
189 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
190
191 # docs generation requires everything to be installed first
192 export PYTHONPATH="$( pwd ):$PYTHONPATH"
193
194 pushd doc
195
196 %if 0%{?with_doc}
197 SPHINX_DEBUG=1 sphinx-build -b html source build/html
198 # Fix hidden-file-or-dir warnings
199 rm -fr build/html/.doctrees build/html/.buildinfo
200 %endif
201
202 # Create dir link to avoid a sphinx-build exception
203 mkdir -p build/man/.doctrees/
204 ln -s .  build/man/.doctrees/man
205 SPHINX_DEBUG=1 sphinx-build -b man -c source source/man build/man
206 mkdir -p %{buildroot}%{_mandir}/man1
207 install -p -D -m 644 build/man/*.1 %{buildroot}%{_mandir}/man1/
208
209 popd
210
211 # Setup directories
212 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder
213 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder/tmp
214 install -d -m 755 %{buildroot}%{_localstatedir}/log/cinder
215
216 # Install config files
217 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder
218 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/cinder/cinder-dist.conf
219 install -p -D -m 640 %{SOURCE14}  %{buildroot}%{_sysconfdir}/cinder/cinder.conf
220 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder/volumes
221 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt/conf.d/cinder.conf
222 install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/rootwrap.conf
223 install -p -D -m 640 etc/cinder/api-paste.ini %{buildroot}%{_sysconfdir}/cinder/api-paste.ini
224 install -p -D -m 640 etc/cinder/policy.json %{buildroot}%{_sysconfdir}/cinder/policy.json
225
226 %if 0%{?rhel} == 6
227 # Install initscripts for services
228 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/openstack-cinder-api
229 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-cinder-scheduler
230 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-cinder-volume
231 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/openstack-cinder-backup
232 %else
233 # Install initscripts for services
234 install -p -D -m 644 %{SOURCE30} %{buildroot}%{_unitdir}/openstack-cinder-api.service
235 install -p -D -m 644 %{SOURCE31} %{buildroot}%{_unitdir}/openstack-cinder-scheduler.service
236 install -p -D -m 644 %{SOURCE32} %{buildroot}%{_unitdir}/openstack-cinder-volume.service
237 install -p -D -m 644 %{SOURCE33} %{buildroot}%{_unitdir}/openstack-cinder-backup.service
238 %endif
239
240 # Install sudoers
241 install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/cinder
242
243 # Install logrotate
244 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-cinder
245
246 # Install pid directory
247 install -d -m 755 %{buildroot}%{_localstatedir}/run/cinder
248
249 # Install rootwrap files in /usr/share/cinder/rootwrap
250 mkdir -p %{buildroot}%{_datarootdir}/cinder/rootwrap/
251 install -p -D -m 644 etc/cinder/rootwrap.d/* %{buildroot}%{_datarootdir}/cinder/rootwrap/
252
253 # Remove unneeded in production stuff
254 rm -f %{buildroot}%{_bindir}/cinder-debug
255 rm -fr %{buildroot}%{python_sitelib}/cinder/tests/
256 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
257 rm -f %{buildroot}/usr/share/doc/cinder/README*
258
259 %pre
260 getent group cinder >/dev/null || groupadd -r cinder --gid 165
261 if ! getent passwd cinder >/dev/null; then
262   useradd -u 165 -r -g cinder -G cinder,nobody -d %{_sharedstatedir}/cinder -s /sbin/nologin -c "OpenStack Cinder Daemons" cinder
263 fi
264 exit 0
265
266 %post
267 %if 0%{?rhel} == 6
268 for svc in volume api scheduler backup; do
269     /sbin/chkconfig --add openstack-cinder-$svc
270 done
271 %else
272 %systemd_post openstack-cinder-volume
273 %systemd_post openstack-cinder-api
274 %systemd_post openstack-cinder-scheduler
275 %systemd_post openstack-cinder-backup
276 %endif
277
278 %preun
279 %if 0%{?rhel} == 6
280 if [ $1 -eq 0 ] ; then
281     for svc in volume api scheduler backup; do
282         /sbin/service openstack-cinder-${svc} stop > /dev/null 2>&1
283         /sbin/chkconfig --del openstack-cinder-${svc}
284     done
285 fi
286 %else
287 %systemd_preun openstack-cinder-volume
288 %systemd_preun openstack-cinder-api
289 %systemd_preun openstack-cinder-scheduler
290 %systemd_preun openstack-cinder-backup
291 %endif
292
293 %postun
294 %if 0%{?rhel} == 6
295 if [ $1 -ge 1 ] ; then
296     # Package upgrade, not uninstall
297     for svc in volume api scheduler backup; do
298         /sbin/service openstack-cinder-${svc} condrestart > /dev/null 2>&1 || :
299     done
300 fi
301 %else
302 %systemd_postun_with_restart openstack-cinder-volume
303 %systemd_postun_with_restart openstack-cinder-api
304 %systemd_postun_with_restart openstack-cinder-scheduler
305 %systemd_postun_with_restart openstack-cinder-backup
306 %endif
307
308 %files
309 %doc LICENSE
310
311 %dir %{_sysconfdir}/cinder
312 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/cinder.conf
313 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/api-paste.ini
314 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/rootwrap.conf
315 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/policy.json
316 %config(noreplace) %{_sysconfdir}/logrotate.d/openstack-cinder
317 %config(noreplace) %{_sysconfdir}/sudoers.d/cinder
318 %config(noreplace) %{_sysconfdir}/tgt/conf.d/cinder.conf
319 %attr(-, root, cinder) %{_datadir}/cinder/cinder-dist.conf
320
321 %dir %attr(0750, cinder, root) %{_localstatedir}/log/cinder
322 %dir %attr(0755, cinder, root) %{_localstatedir}/run/cinder
323 %dir %attr(0755, cinder, root) %{_sysconfdir}/cinder/volumes
324
325 %{_bindir}/cinder-*
326
327 %if 0%{?rhel} == 6
328 %{_initrddir}/openstack-cinder-*
329 %else
330 %{_unitdir}/*.service
331 %endif
332
333 %{_datarootdir}/cinder
334 %{_mandir}/man1/cinder*.1.gz
335
336 %defattr(-, cinder, cinder, -)
337 %dir %{_sharedstatedir}/cinder
338 %dir %{_sharedstatedir}/cinder/tmp
339
340 %files -n python-cinder
341 %doc LICENSE
342 %{python_sitelib}/cinder
343 %{python_sitelib}/cinder-%{version}*.egg-info
344
345 %if 0%{?with_doc}
346 %files doc
347 %doc doc/build/html
348 %endif
349
350 %changelog
351 * Mon Sep 28 2015 Mikhail Ivanov <mivanov@mirantis.com> - 7.0.0.0rc1-1~mos8.0.1
352 - Update to a new upstream version
353 - Update build and runtime dependencies
354
355 * Wed Jun 11 2014 Eric Harney <eharney@redhat.com> - 2014.1.1-2
356 - Add dependency on iscsi-initiator-utils
357
358 * Mon Jun 09 2014 Eric Harney <eharney@redhat.com> - 2014.1.1-1
359 - Update to Icehouse stable release 1
360
361 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2014.1-4
362 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
363
364 * Tue Apr 29 2014 Alan Pevec <apevec@redhat.com> - 2014.1-3
365 - drop crudini build dependency
366
367 * Mon Apr 21 2014 Eric Harney <eharney@redhat.com> - 2014.1-2
368 - Remove qpid settings from cinder-dist.conf
369
370 * Thu Apr 17 2014 Eric Harney <eharney@redhat.com> - 2014.1-1
371 - Update to 2014.1 (Icehouse)
372
373 * Tue Apr 15 2014 Eric Harney <eharney@redhat.com> - 2014.1-0.10.rc3
374 - Add python-oslo-messaging requirement
375 - Add GlusterFS delete patch
376 - Add systemd patches (not used yet)
377
378 * Tue Apr 15 2014 Eric Harney <eharney@redhat.com> - 2014.1-0.9.rc3
379 - Update to Icehouse RC3
380
381 * Mon Apr 07 2014 Eric Harney <eharney@redhat.com> - 2014.1-0.8.rc2
382 - Update to Icehouse RC2
383 - Icehouse requires newer version of python-six
384
385 * Thu Mar 27 2014 Eric Harney <eharney@redhat.com> - 2014.1-0.7.rc1
386 - Update to Icehouse RC1
387
388 * Tue Mar 25 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.6.b3
389 - Depend on python-rtslib and targetcli rather than scsi-target-utils
390
391 * Fri Mar 21 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.5.b3
392 - Use lioadm iSCSI helper rather than tgtadm
393
394 * Sun Mar 16 2014 Eric Harney <eharney@redhat.com> - 2014.1-0.4.b3
395 - Update to Icehouse milestone 3
396 - Add deps on python-oslo-rootwrap, python-taskflow
397
398 * Mon Jan 27 2014 Eric Harney <eharney@redhat.com> - 2014.1-0.3.b2
399 - Update to Icehouse milestone 2
400
401 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
402 - Set python-six min version to ensure updated
403
404 * Thu Dec 19 2013 Eric Harney <eharney@redhat.com> - 2014.1-0.1.b1
405 - Update to Icehouse milestone 1
406
407 * Mon Oct 28 2013 Eric Harney <eharney@redhat.com> - 2013.2-2
408 - Fix GlusterFS volume driver clone operations
409
410 * Thu Oct 17 2013 Eric Harney <eharney@redhat.com> - 2013.2-1
411 - Update to 2013.2 (Havana)
412 - Restart/remove cinder-backup service during upgrade/uninstallation
413
414 * Wed Oct 16 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.13.rc3
415 - Update to Havana RC3
416
417 * Fri Oct 11 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.12.rc2
418 - Update to Havana RC2
419
420 * Tue Oct 08 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.11.rc1
421 - Update to Havana RC1
422 - Fix python-novaclient req epoch
423
424 * Mon Sep 23 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.10.b3
425 - Depend on python-novaclient 2.15
426
427 * Wed Sep 18 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.9.b3
428 - Add cinder-dist.conf
429 - Tighten permissions on /var/log/cinder
430
431 * Mon Sep 9 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.8.b3
432 - Update to Havana milestone 3
433 - Add dependency on python-novaclient
434
435 * Thu Aug 29 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b2
436 - Add dependency on sysfsutils to support the fiber channel driver
437
438 * Mon Aug 26 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.6.b2
439 - Add cinder-backup service init script
440
441 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.2-0.5.b2
442 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
443
444 * Mon Jul 22 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b2
445 - Add dependency on python-suds to support the netapp driver
446 - Add dependency on python-keystoneclient for auth token middleware
447 - Add dependency on qemu-img for volume creation from Glance images
448
449 * Sun Jul 21 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.3.b2
450 - Update to Havana milestone 2
451
452 * Thu Jun 13 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.2.b1
453 - Update to Havana milestone 1
454
455 * Mon May 13 2013 Eric Harney <eharney@redhat.com> - 2013.1.1-1
456 - Update to Grizzly stable release 1, 2013.1.1
457
458 * Mon Apr 08 2013 Eric Harney <eharney@redhat.com> - 2013.1-2
459 - Backport fix for GlusterFS driver get_volume_stats
460
461 * Thu Apr 04 2013 Eric Harney <eharney@redhat.com> - 2013.1-1
462 - Update to Grizzly final release
463
464 * Tue Apr  2 2013 Pádraig Brady <pbrady@redhat.com> - 2013.1-0.6.rc3
465 - Adjust to support sqlalchemy-0.8.0
466
467 * Wed Mar 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc3
468 - Update to Grizzly RC3 release
469
470 * Mon Mar 25 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc2
471 - Update to Grizzly RC2 release
472
473 * Mon Mar 18 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc1
474 - Update to Grizzly RC1 release
475
476 * Tue Mar 05 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.4.g3
477 - Add dependency on python-stevedore
478
479 * Mon Feb 25 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.3.g3
480 - Fix build issues with G-3 update
481
482 * Mon Feb 25 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.2.g3
483 - Update to Grizzly milestone 3
484
485 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2013.1-0.2.g2
486 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
487
488 * Thu Jan 10 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g2
489 - Update to Grizzly milestone 2
490
491 * Thu Nov 29 2012 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g1
492 - Update to Grizzly milestone 1
493
494 * Wed Nov 14 2012 Eric Harney <eharney@redhat.com> - 2012.2-2
495 - Remove unused dependency on python-daemon
496
497 * Thu Sep 27 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-1
498 - Update to Folsom final
499
500 * Fri Sep 21 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-0.5.rc1
501 - Update to Folsom RC1
502
503 * Fri Sep 21 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-0.4.f3
504 - Fix to ensure that tgt configuration is honored
505
506 * Mon Sep 17 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-0.3.f3
507 - Move user config out of /etc/cinder/api-paste.ini
508 - Require python-cinderclient
509
510 * Mon Sep  3 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-0.2.f3
511 - Initial release