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