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