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