]> review.fuel-infra Code Review - openstack-build/cinder-build.git/blob - rpm/SPECS/openstack-cinder.spec
Adding python-ceph dependency. LP #1318518
[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.1
5 Release:          0.2.rc1%{?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/icehouse-1/+download/cinder-%{version}.b1.tar.gz
12 Source1:          cinder-dist.conf
13 Source2:          cinder.logrotate
14 Source3:          cinder-tgt.conf
15
16 Source10:         openstack-cinder-api.init
17 Source100:        openstack-cinder-api.upstart
18 Source11:         openstack-cinder-scheduler.init
19 Source110:        openstack-cinder-scheduler.upstart
20 Source12:         openstack-cinder-volume.init
21 Source120:        openstack-cinder-volume.upstart
22 Source13:         openstack-cinder-backup.init
23 Source130:        openstack-cinder-backup.upstart
24
25 Source20:         cinder-sudoers
26
27 #
28 # patches_base=2014.1.b1
29 #
30 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
31 Patch0002: 0002-Use-updated-parallel-install-versions-of-epel-packag.patch
32 Patch0003: 0003-Remove-runtime-dep-on-python-pbr-python-d2to1.patch
33 Patch0004: 0004-Revert-Use-oslo.sphinx-and-remove-local-copy-of-doc-.patch
34
35 BuildArch:        noarch
36 BuildRequires:    intltool
37 BuildRequires:    python-d2to1
38 BuildRequires:    python-pbr
39 BuildRequires:    python-sphinx10
40 BuildRequires:    python-setuptools
41 BuildRequires:    python-netaddr
42 BuildRequires:    openstack-utils
43 BuildRequires:    python-paste-deploy1.5
44 BuildRequires:    python-routes1.12
45 BuildRequires:    python-sqlalchemy0.7
46 BuildRequires:    python-webob1.2
47
48 Requires:         openstack-utils
49 Requires:         python-cinder = %{version}-%{release}
50
51 # as convenience
52 Requires:         python-cinderclient
53
54 Requires(post):   chkconfig
55 Requires(postun): initscripts
56 Requires(preun):  chkconfig
57 Requires(pre):    shadow-utils
58
59 Requires:         lvm2
60 Requires:         scsi-target-utils
61
62 %description
63 OpenStack Volume (codename Cinder) provides services to manage and
64 access block storage volumes for use by Virtual Machine instances.
65
66
67 %package -n       python-cinder
68 Summary:          OpenStack Volume Python libraries
69 Group:            Applications/System
70
71 Requires:         sudo
72
73 Requires:         MySQL-python
74
75 Requires:         qemu-img
76 Requires:         sysfsutils
77
78 Requires:         python-paramiko
79
80 Requires:         python-qpid
81 Requires:         python-kombu
82 Requires:         python-amqplib
83
84 Requires:         python-eventlet
85 Requires:         python-greenlet
86 Requires:         python-iso8601
87 Requires:         python-netaddr
88 Requires:         python-lxml
89 Requires:         python-anyjson
90 Requires:         python-cheetah
91 Requires:         python-stevedore
92 Requires:         python-suds
93
94 Requires:         python-sqlalchemy0.7
95 Requires:         python-migrate
96
97 Requires:         python-paste-deploy1.5
98 Requires:         python-routes1.12
99 Requires:         python-webob1.2
100
101 Requires:         python-glanceclient >= 1:0
102 Requires:         python-swiftclient >= 1.2
103 Requires:         python-keystoneclient
104 Requires:         python-novaclient >= 1:2.15
105
106 Requires:         python-oslo-config >= 1:1.2.0
107 Requires:         python-six >= 1.4.1
108
109 Requires:         python-babel
110 Requires:         python-lockfile
111
112 Requires:         python-oslo-rootwrap
113 Requires:         python-taskflow
114
115 Requires:         python-ceph
116
117 %description -n   python-cinder
118 OpenStack Volume (codename Cinder) provides services to manage and
119 access block storage volumes for use by Virtual Machine instances.
120
121 This package contains the cinder Python library.
122
123 %if 0%{?with_doc}
124 %package doc
125 Summary:          Documentation for OpenStack Volume
126 Group:            Documentation
127
128 Requires:         %{name} = %{version}-%{release}
129
130 BuildRequires:    graphviz
131
132 # Required to build module documents
133 BuildRequires:    python-eventlet
134 BuildRequires:    python-routes1.12
135 BuildRequires:    python-sqlalchemy0.7
136 BuildRequires:    python-webob1.2
137 # while not strictly required, quiets the build down when building docs.
138 BuildRequires:    python-migrate, python-iso8601
139
140 %description      doc
141 OpenStack Volume (codename Cinder) provides services to manage and
142 access block storage volumes for use by Virtual Machine instances.
143
144 This package contains documentation files for cinder.
145 %endif
146
147 %prep
148 %setup -q -n cinder-%{version}
149
150 %patch0001 -p1
151 %patch0002 -p1
152 %patch0003 -p1
153 %patch0004 -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
172 # Move authtoken configuration out of paste.ini
173 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_tenant_name
174 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_user
175 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_password
176 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_host
177 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_port
178 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_protocol
179
180 %{__python} setup.py build
181
182 %install
183 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
184
185 # docs generation requires everything to be installed first
186 export PYTHONPATH="$( pwd ):$PYTHONPATH"
187
188 pushd doc
189
190 %if 0%{?with_doc}
191 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
192 # Fix hidden-file-or-dir warnings
193 rm -fr build/html/.doctrees build/html/.buildinfo
194 %endif
195
196 # Create dir link to avoid a sphinx-build exception
197 mkdir -p build/man/.doctrees/
198 ln -s .  build/man/.doctrees/man
199 SPHINX_DEBUG=1 sphinx-1.0-build -b man -c source source/man build/man
200 mkdir -p %{buildroot}%{_mandir}/man1
201 install -p -D -m 644 build/man/*.1 %{buildroot}%{_mandir}/man1/
202
203 popd
204
205 # Setup directories
206 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder
207 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder/tmp
208 install -d -m 755 %{buildroot}%{_localstatedir}/log/cinder
209
210 # Install config files
211 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder
212 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/cinder/cinder-dist.conf
213 install -p -D -m 640 etc/cinder/cinder.conf.sample %{buildroot}%{_sysconfdir}/cinder/cinder.conf
214 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder/volumes
215 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt/conf.d/cinder.conf
216 install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/rootwrap.conf
217 install -p -D -m 640 etc/cinder/api-paste.ini %{buildroot}%{_sysconfdir}/cinder/api-paste.ini
218 install -p -D -m 640 etc/cinder/policy.json %{buildroot}%{_sysconfdir}/cinder/policy.json
219
220 # Install initscripts for services
221 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/openstack-cinder-api
222 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-cinder-scheduler
223 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-cinder-volume
224 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/openstack-cinder-backup
225
226 # Install sudoers
227 install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/cinder
228
229 # Install logrotate
230 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-cinder
231
232 # Install pid directory
233 install -d -m 755 %{buildroot}%{_localstatedir}/run/cinder
234
235 # Install upstart jobs examples
236 install -d -m 755 %{buildroot}%{_datadir}/cinder
237 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/cinder/
238 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/cinder/
239 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/cinder/
240 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/cinder/
241
242 # Install rootwrap files in /usr/share/cinder/rootwrap
243 mkdir -p %{buildroot}%{_datarootdir}/cinder/rootwrap/
244 install -p -D -m 644 etc/cinder/rootwrap.d/* %{buildroot}%{_datarootdir}/cinder/rootwrap/
245
246 # Remove unneeded in production stuff
247 rm -f %{buildroot}%{_bindir}/cinder-debug
248 rm -fr %{buildroot}%{python_sitelib}/cinder/tests/
249 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
250 rm -f %{buildroot}/usr/share/doc/cinder/README*
251
252 %pre
253 getent group cinder >/dev/null || groupadd -r cinder --gid 165
254 if ! getent passwd cinder >/dev/null; then
255   useradd -u 165 -r -g cinder -G cinder,nobody -d %{_sharedstatedir}/cinder -s /sbin/nologin -c "OpenStack Cinder Daemons" cinder
256 fi
257 exit 0
258
259 %post
260 for svc in volume api scheduler backup; do
261     /sbin/chkconfig --add openstack-cinder-$svc
262 done
263
264 %preun
265 if [ $1 -eq 0 ] ; then
266     for svc in volume api scheduler backup; do
267         /sbin/service openstack-cinder-${svc} stop > /dev/null 2>&1
268         /sbin/chkconfig --del openstack-cinder-${svc}
269     done
270 fi
271
272 %postun
273 if [ $1 -ge 1 ] ; then
274     # Package upgrade, not uninstall
275     for svc in volume api scheduler backup; do
276         /sbin/service openstack-cinder-${svc} condrestart > /dev/null 2>&1 || :
277     done
278 fi
279
280 %files
281 %doc LICENSE
282
283 %dir %{_sysconfdir}/cinder
284 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/cinder.conf
285 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/api-paste.ini
286 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/rootwrap.conf
287 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/policy.json
288 %config(noreplace) %{_sysconfdir}/logrotate.d/openstack-cinder
289 %config(noreplace) %{_sysconfdir}/sudoers.d/cinder
290 %config(noreplace) %{_sysconfdir}/tgt/conf.d/cinder.conf
291 %attr(-, root, cinder) %{_datadir}/cinder/cinder-dist.conf
292
293 %dir %attr(0750, cinder, root) %{_localstatedir}/log/cinder
294 %dir %attr(0755, cinder, root) %{_localstatedir}/run/cinder
295 %dir %attr(0755, cinder, root) %{_sysconfdir}/cinder/volumes
296
297 %{_bindir}/cinder-*
298 %{_initrddir}/openstack-cinder-*
299 %{_datarootdir}/cinder
300 %{_mandir}/man1/cinder*.1.gz
301
302 %defattr(-, cinder, cinder, -)
303 %dir %{_sharedstatedir}/cinder
304 %dir %{_sharedstatedir}/cinder/tmp
305
306 %files -n python-cinder
307 %doc LICENSE
308 %{python_sitelib}/cinder
309 %{python_sitelib}/cinder-%{version}*.egg-info
310
311 %if 0%{?with_doc}
312 %files doc
313 %doc doc/build/html
314 %endif
315
316 %changelog
317 * Mon Jan 06 2014 Pádraig Brady <pbrady@redhat.com> - 2014.1-0.2.b1
318 - Set python-six min version to ensure updated
319
320 * Thu Dec 19 2013 Eric Harney <eharney@redhat.com> - 2014.1-0.1.b1
321 - Update to Icehouse milestone 1
322
323 * Tue Dec 17 2013 Eric Harney <eharney@redhat.com> - 2013.2.1-1
324 - Update to Havana stable release 1
325
326 * Mon Oct 28 2013 Eric Harney <eharney@redhat.com> - 2013.2-2
327 - Fix GlusterFS volume driver clone operations
328
329 * Thu Oct 17 2013 Eric Harney <eharney@redhat.com> - 2013.2-1
330 - Update to 2013.2 (Havana)
331 - Handle cinder-backup service registration/restart/removal
332
333 * Wed Oct 16 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.13.rc3
334 - Update to Havana RC3
335
336 * Tue Oct 15 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.12.rc2
337 - Update to Havana RC2
338
339 * Tue Oct 08 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.11.rc1
340 - Update to Havana RC1
341 - Fix python-novaclient req epoch
342
343 * Mon Sep 23 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.10.b3
344 - Depend on python-novaclient 2.15
345
346 * Wed Sep 18 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.9.b3
347 - Add cinder-dist.conf
348 - Tighten permissions on /var/log/cinder
349
350 * Mon Sep 9 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.8.b3
351 - Update to Havana milestone 3
352 - Add dependency on python-novaclient
353
354 * Thu Aug 29 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b2
355 - Add dependency on sysfsutils to support the fiber channel driver
356
357 * Mon Aug 26 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.5.b2
358 - Add cinder-backup service init script
359
360 * Mon Jul 22 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b2
361 - Add dependency on python-suds to support the netapp driver
362 - Add dependency on python-keystoneclient for auth token middleware
363 - Add dependency on qemu-img for volume creation from Glance images
364
365 * Sun Jul 21 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.3.b2
366 - Update to Havana milestone 2
367
368 * Thu Jun 13 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.2.b1
369 - Update to Havana milestone 1
370
371 * Fri May 10 2013 Eric Harney <eharney@redhat.com> - 2013.1.1-1
372 - Update to Grizzly stable release 1
373
374 * Mon Apr 08 2013 Eric Harney <eharney@redhat.com> - 2013.1-2
375 - Backport fix for GlusterFS driver get_volume_stats
376 - Adjust to support sqlalchemy-0.8.0
377
378 * Thu Apr 04 2013 Eric Harney <eharney@redhat.com> - 2013.1-1
379 - Update to Grizzly final release
380
381 * Wed Mar 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc3
382 - Update to Grizzly RC3 release
383
384 * Mon Mar 25 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc2
385 - Update to Grizzly RC2 release
386
387 * Mon Mar 18 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc1
388 - Update to Grizzly RC1 release
389
390 * Tue Mar 05 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.4.g3
391 - Add dependency on python-stevedore
392
393 * Wed Feb 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.2.g3
394 - Update to Grizzly milestone 3
395
396 * Thu Jan 10 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g2
397 - Update to Grizzly milestone 2
398
399 * Thu Dec 20 2012 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g1
400 - Update to Grizzly milestone 1
401
402 * Mon Dec 03 2012 Eric Harney <eharney@redhat.com> - 2012.2.1-1
403 - Update to Folsom stable release 1
404
405 * Wed Nov 14 2012 Eric Harney <eharney@redhat.com> - 2012.2-4
406 - Remove unused dependency on python-daemon
407
408 * Wed Oct 31 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-3
409 - Adjust to be compatible with python-migrate-0.6
410
411 * Wed Oct 24 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-2
412 - Initial Folsom release