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