Merge "Update RPM-specs to 2013.2 version" into openstack-ci/build/havana
[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:          2013.2
5 Release:          0.8.b3%{?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/havana/havana-3/+download/cinder-%{version}.b3.tar.gz
12 Source1:          cinder.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=2013.2.b3
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 >= 2.14
105
106 Requires:         python-oslo-config
107 Requires:         python-six
108
109 Requires:         python-babel
110 Requires:         python-lockfile
111
112 %description -n   python-cinder
113 OpenStack Volume (codename Cinder) provides services to manage and
114 access block storage volumes for use by Virtual Machine instances.
115
116 This package contains the cinder Python library.
117
118 %if 0%{?with_doc}
119 %package doc
120 Summary:          Documentation for OpenStack Volume
121 Group:            Documentation
122
123 Requires:         %{name} = %{version}-%{release}
124
125 BuildRequires:    graphviz
126
127 # Required to build module documents
128 BuildRequires:    python-eventlet
129 BuildRequires:    python-routes1.12
130 BuildRequires:    python-sqlalchemy0.7
131 BuildRequires:    python-webob1.2
132 # while not strictly required, quiets the build down when building docs.
133 BuildRequires:    python-migrate, python-iso8601
134
135 %description      doc
136 OpenStack Volume (codename Cinder) provides services to manage and
137 access block storage volumes for use by Virtual Machine instances.
138
139 This package contains documentation files for cinder.
140 %endif
141
142 %prep
143 %setup -q -n cinder-%{version}
144
145 %patch0001 -p1
146 %patch0002 -p1
147 %patch0003 -p1
148 %patch0004 -p1
149
150 find . \( -name .gitignore -o -name .placeholder \) -delete
151
152 find cinder -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
153
154 # TODO: Have the following handle multi line entries
155 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
156
157 # Remove the requirements file so that pbr hooks don't add it
158 # to distutils requires_dist config
159 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
160
161 # We add REDHATCINDERVERSION/RELEASE with the pbr removal patch
162 sed -i s/REDHATCINDERVERSION/%{version}/ cinder/version.py
163 sed -i s/REDHATCINDERRELEASE/%{release}/ cinder/version.py
164
165 %build
166
167 # Move authtoken configuration out of paste.ini
168 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_tenant_name
169 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_user
170 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_password
171 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_host
172 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_port
173 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_protocol
174
175 %{__python} setup.py build
176
177 %install
178 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
179
180 # docs generation requires everything to be installed first
181 export PYTHONPATH="$( pwd ):$PYTHONPATH"
182
183 pushd doc
184
185 %if 0%{?with_doc}
186 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
187 # Fix hidden-file-or-dir warnings
188 rm -fr build/html/.doctrees build/html/.buildinfo
189 %endif
190
191 # Create dir link to avoid a sphinx-build exception
192 mkdir -p build/man/.doctrees/
193 ln -s .  build/man/.doctrees/man
194 SPHINX_DEBUG=1 sphinx-1.0-build -b man -c source source/man build/man
195 mkdir -p %{buildroot}%{_mandir}/man1
196 install -p -D -m 644 build/man/*.1 %{buildroot}%{_mandir}/man1/
197
198 popd
199
200 # Setup directories
201 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder
202 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder/tmp
203 install -d -m 755 %{buildroot}%{_localstatedir}/log/cinder
204
205 # Install config files
206 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder
207 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/cinder/cinder.conf
208 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder/volumes
209 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt/conf.d/cinder.conf
210 install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/rootwrap.conf
211 install -p -D -m 640 etc/cinder/api-paste.ini %{buildroot}%{_sysconfdir}/cinder/api-paste.ini
212 install -p -D -m 640 etc/cinder/policy.json %{buildroot}%{_sysconfdir}/cinder/policy.json
213
214 # Install initscripts for services
215 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/openstack-cinder-api
216 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-cinder-scheduler
217 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-cinder-volume
218 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/openstack-cinder-backup
219
220 # Install sudoers
221 install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/cinder
222
223 # Install logrotate
224 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-cinder
225
226 # Install pid directory
227 install -d -m 755 %{buildroot}%{_localstatedir}/run/cinder
228
229 # Install upstart jobs examples
230 install -d -m 755 %{buildroot}%{_datadir}/cinder
231 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/cinder/
232 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/cinder/
233 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/cinder/
234 install -p -m 644 %{SOURCE130} %{buildroot}%{_datadir}/cinder/
235
236 # Install rootwrap files in /usr/share/cinder/rootwrap
237 mkdir -p %{buildroot}%{_datarootdir}/cinder/rootwrap/
238 install -p -D -m 644 etc/cinder/rootwrap.d/* %{buildroot}%{_datarootdir}/cinder/rootwrap/
239
240 # Remove unneeded in production stuff
241 rm -f %{buildroot}%{_bindir}/cinder-debug
242 rm -fr %{buildroot}%{python_sitelib}/cinder/tests/
243 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
244 rm -f %{buildroot}/usr/share/doc/cinder/README*
245
246 %pre
247 getent group cinder >/dev/null || groupadd -r cinder --gid 165
248 if ! getent passwd cinder >/dev/null; then
249   useradd -u 165 -r -g cinder -G cinder,nobody -d %{_sharedstatedir}/cinder -s /sbin/nologin -c "OpenStack Cinder Daemons" cinder
250 fi
251 exit 0
252
253 %post
254 if [ $1 -eq 1 ] ; then
255     # Initial installation
256     for svc in volume api scheduler; do
257         /sbin/chkconfig --add openstack-cinder-$svc
258     done
259 fi
260
261 %preun
262 if [ $1 -eq 0 ] ; then
263     for svc in volume api scheduler; do
264         /sbin/service openstack-cinder-${svc} stop > /dev/null 2>&1
265         /sbin/chkconfig --del openstack-cinder-${svc}
266     done
267 fi
268
269 %postun
270 if [ $1 -ge 1 ] ; then
271     # Package upgrade, not uninstall
272     for svc in volume api scheduler; do
273         /sbin/service openstack-cinder-${svc} condrestart > /dev/null 2>&1 || :
274     done
275 fi
276
277 %files
278 %doc LICENSE
279
280 %dir %{_sysconfdir}/cinder
281 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/cinder.conf
282 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/api-paste.ini
283 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/rootwrap.conf
284 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/policy.json
285 %config(noreplace) %{_sysconfdir}/logrotate.d/openstack-cinder
286 %config(noreplace) %{_sysconfdir}/sudoers.d/cinder
287 %config(noreplace) %{_sysconfdir}/tgt/conf.d/cinder.conf
288
289 %dir %attr(0755, cinder, root) %{_localstatedir}/log/cinder
290 %dir %attr(0755, cinder, root) %{_localstatedir}/run/cinder
291 %dir %attr(0755, cinder, root) %{_sysconfdir}/cinder/volumes
292
293 %{_bindir}/cinder-*
294 %{_initrddir}/openstack-cinder-*
295 %{_datarootdir}/cinder
296 %{_mandir}/man1/cinder*.1.gz
297
298 %defattr(-, cinder, cinder, -)
299 %dir %{_sharedstatedir}/cinder
300 %dir %{_sharedstatedir}/cinder/tmp
301
302 %files -n python-cinder
303 %doc LICENSE
304 %{python_sitelib}/cinder
305 %{python_sitelib}/cinder-%{version}*.egg-info
306
307 %if 0%{?with_doc}
308 %files doc
309 %doc doc/build/html
310 %endif
311
312 %changelog
313 * Mon Sep 9 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.8.b3
314 - Update to Havana milestone 3
315 - Add dependency on python-novaclient
316
317 * Thu Aug 29 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.7.b2
318 - Add dependency on sysfsutils to support the fiber channel driver
319
320 * Mon Aug 26 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.5.b2
321 - Add cinder-backup service init script
322
323 * Mon Jul 22 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.4.b2
324 - Add dependency on python-suds to support the netapp driver
325 - Add dependency on python-keystoneclient for auth token middleware
326 - Add dependency on qemu-img for volume creation from Glance images
327
328 * Sun Jul 21 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2-0.3.b2
329 - Update to Havana milestone 2
330
331 * Thu Jun 13 2013 Eric Harney <eharney@redhat.com> - 2013.2-0.2.b1
332 - Update to Havana milestone 1
333
334 * Fri May 10 2013 Eric Harney <eharney@redhat.com> - 2013.1.1-1
335 - Update to Grizzly stable release 1
336
337 * Mon Apr 08 2013 Eric Harney <eharney@redhat.com> - 2013.1-2
338 - Backport fix for GlusterFS driver get_volume_stats
339 - Adjust to support sqlalchemy-0.8.0
340
341 * Thu Apr 04 2013 Eric Harney <eharney@redhat.com> - 2013.1-1
342 - Update to Grizzly final release
343
344 * Wed Mar 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc3
345 - Update to Grizzly RC3 release
346
347 * Mon Mar 25 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc2
348 - Update to Grizzly RC2 release
349
350 * Mon Mar 18 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc1
351 - Update to Grizzly RC1 release
352
353 * Tue Mar 05 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.4.g3
354 - Add dependency on python-stevedore
355
356 * Wed Feb 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.2.g3
357 - Update to Grizzly milestone 3
358
359 * Thu Jan 10 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g2
360 - Update to Grizzly milestone 2
361
362 * Thu Dec 20 2012 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g1
363 - Update to Grizzly milestone 1
364
365 * Mon Dec 03 2012 Eric Harney <eharney@redhat.com> - 2012.2.1-1
366 - Update to Folsom stable release 1
367
368 * Wed Nov 14 2012 Eric Harney <eharney@redhat.com> - 2012.2-4
369 - Remove unused dependency on python-daemon
370
371 * Wed Oct 31 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-3
372 - Adjust to be compatible with python-migrate-0.6
373
374 * Wed Oct 24 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-2
375 - Initial Folsom release