]> review.fuel-infra Code Review - openstack-build/cinder-build.git/blob - rpm/SPECS/openstack-cinder.spec
Update spec 2013.1.3
[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.1.2
5 Release:          4%{?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/grizzly/%{version}/+download/cinder-%{version}.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
23 Source20:         cinder-sudoers
24
25 #
26 # patches_base=2013.1.2
27 #
28 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
29 Patch0002: 0002-Use-updated-parallel-install-versions-of-epel-packag.patch
30 Patch0003: 0003-remove-deprecated-assert_unicode-sqlalchemy-attribut.patch
31 Patch0004: 0004-avoid-code-path-causing-qpid-exchange-leaks.patch
32
33 BuildArch:        noarch
34 BuildRequires:    intltool
35 BuildRequires:    python-sphinx10
36 BuildRequires:    python-setuptools
37 BuildRequires:    python-netaddr
38 BuildRequires:    openstack-utils
39 # These are required to build due to the requirements check added
40 BuildRequires:    python-paste-deploy1.5
41 BuildRequires:    python-routes1.12
42 BuildRequires:    python-sqlalchemy0.7
43 BuildRequires:    python-webob1.0
44
45 Requires:         openstack-utils
46 Requires:         python-cinder = %{version}-%{release}
47
48 # as convenience
49 Requires:         python-cinderclient
50
51 Requires(post):   chkconfig
52 Requires(postun): initscripts
53 Requires(preun):  chkconfig
54 Requires(pre):    shadow-utils
55
56 Requires:         lvm2
57 Requires:         scsi-target-utils
58
59 %description
60 OpenStack Volume (codename Cinder) provides services to manage and
61 access block storage volumes for use by Virtual Machine instances.
62
63
64 %package -n       python-cinder
65 Summary:          OpenStack Volume Python libraries
66 Group:            Applications/System
67
68 Requires:         sudo
69 Requires:         MySQL-python
70
71 Requires:         qemu-img
72
73 Requires:         python-paramiko
74
75 Requires:         python-qpid
76 Requires:         python-kombu
77 Requires:         python-amqplib
78
79 Requires:         python-eventlet
80 Requires:         python-greenlet
81 Requires:         python-iso8601
82 Requires:         python-netaddr
83 Requires:         python-lxml
84 Requires:         python-anyjson
85 Requires:         python-cheetah
86 Requires:         python-stevedore
87 Requires:         python-suds
88
89 Requires:         python-sqlalchemy0.7
90 Requires:         python-migrate
91
92 Requires:         python-paste-deploy1.5
93 Requires:         python-routes1.12
94 Requires:         python-webob1.0
95
96 Requires:         python-glanceclient >= 1:0
97 Requires:         python-keystoneclient
98 Requires:         python-oslo-config
99
100 %description -n   python-cinder
101 OpenStack Volume (codename Cinder) provides services to manage and
102 access block storage volumes for use by Virtual Machine instances.
103
104 This package contains the cinder Python library.
105
106 %if 0%{?with_doc}
107 %package doc
108 Summary:          Documentation for OpenStack Volume
109 Group:            Documentation
110
111 Requires:         %{name} = %{version}-%{release}
112
113 BuildRequires:    graphviz
114
115 # Required to build module documents
116 BuildRequires:    python-eventlet
117 BuildRequires:    python-routes1.12
118 BuildRequires:    python-sqlalchemy0.7
119 BuildRequires:    python-webob1.0
120 # while not strictly required, quiets the build down when building docs.
121 BuildRequires:    python-migrate, python-iso8601
122
123 %description      doc
124 OpenStack Volume (codename Cinder) provides services to manage and
125 access block storage volumes for use by Virtual Machine instances.
126
127 This package contains documentation files for cinder.
128 %endif
129
130 %prep
131 %setup -q -n cinder-%{version}
132
133 %patch0001 -p1
134 %patch0002 -p1
135 %patch0003 -p1
136 %patch0004 -p1
137
138 find . \( -name .gitignore -o -name .placeholder \) -delete
139
140 find cinder -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
141
142 # TODO: Have the following handle multi line entries
143 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
144
145 %build
146
147 # Move authtoken configuration out of paste.ini
148 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_tenant_name
149 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_user
150 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_password
151 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_host
152 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_port
153 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_protocol
154
155 %{__python} setup.py build
156
157 %install
158 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
159
160 # docs generation requires everything to be installed first
161 export PYTHONPATH="$( pwd ):$PYTHONPATH"
162
163 pushd doc
164
165 %if 0%{?with_doc}
166 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
167 # Fix hidden-file-or-dir warnings
168 rm -fr build/html/.doctrees build/html/.buildinfo
169 %endif
170
171 # Create dir link to avoid a sphinx-build exception
172 mkdir -p build/man/.doctrees/
173 ln -s .  build/man/.doctrees/man
174 SPHINX_DEBUG=1 sphinx-1.0-build -b man -c source source/man build/man
175 mkdir -p %{buildroot}%{_mandir}/man1
176 install -p -D -m 644 build/man/*.1 %{buildroot}%{_mandir}/man1/
177
178 popd
179
180 # Setup directories
181 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder
182 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder/tmp
183 install -d -m 755 %{buildroot}%{_localstatedir}/log/cinder
184
185 # Install config files
186 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder
187 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/cinder/cinder.conf
188 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder/volumes
189 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt/conf.d/cinder.conf
190 install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/rootwrap.conf
191 install -p -D -m 640 etc/cinder/api-paste.ini %{buildroot}%{_sysconfdir}/cinder/api-paste.ini
192 install -p -D -m 640 etc/cinder/policy.json %{buildroot}%{_sysconfdir}/cinder/policy.json
193
194 # Install initscripts for services
195 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/openstack-cinder-api
196 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-cinder-scheduler
197 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-cinder-volume
198
199 # Install sudoers
200 install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/cinder
201
202 # Install logrotate
203 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-cinder
204
205 # Install pid directory
206 install -d -m 755 %{buildroot}%{_localstatedir}/run/cinder
207
208 # Install upstart jobs examples
209 install -d -m 755 %{buildroot}%{_datadir}/cinder
210 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/cinder/
211 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/cinder/
212 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/cinder/
213
214 # Install rootwrap files in /usr/share/cinder/rootwrap
215 mkdir -p %{buildroot}%{_datarootdir}/cinder/rootwrap/
216 install -p -D -m 644 etc/cinder/rootwrap.d/* %{buildroot}%{_datarootdir}/cinder/rootwrap/
217
218 # Remove unneeded in production stuff
219 rm -f %{buildroot}%{_bindir}/cinder-debug
220 rm -fr %{buildroot}%{python_sitelib}/cinder/tests/
221 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
222 rm -f %{buildroot}/usr/share/doc/cinder/README*
223
224 %pre
225 getent group cinder >/dev/null || groupadd -r cinder --gid 165
226 if ! getent passwd cinder >/dev/null; then
227   useradd -u 165 -r -g cinder -G cinder,nobody -d %{_sharedstatedir}/cinder -s /sbin/nologin -c "OpenStack Cinder Daemons" cinder
228 fi
229 exit 0
230
231 %post
232 if [ $1 -eq 1 ] ; then
233     # Initial installation
234     for svc in volume api scheduler; do
235         /sbin/chkconfig --add openstack-cinder-$svc
236     done
237 fi
238
239 %preun
240 if [ $1 -eq 0 ] ; then
241     for svc in volume api scheduler; do
242         /sbin/service openstack-cinder-${svc} stop > /dev/null 2>&1
243         /sbin/chkconfig --del openstack-cinder-${svc}
244     done
245 fi
246
247 %postun
248 if [ $1 -ge 1 ] ; then
249     # Package upgrade, not uninstall
250     for svc in volume api scheduler; do
251         /sbin/service openstack-cinder-${svc} condrestart > /dev/null 2>&1 || :
252     done
253 fi
254
255 %files
256 %doc LICENSE
257
258 %dir %{_sysconfdir}/cinder
259 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/cinder.conf
260 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/api-paste.ini
261 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/rootwrap.conf
262 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/policy.json
263 %config(noreplace) %{_sysconfdir}/logrotate.d/openstack-cinder
264 %config(noreplace) %{_sysconfdir}/sudoers.d/cinder
265 %config(noreplace) %{_sysconfdir}/tgt/conf.d/cinder.conf
266
267 %dir %attr(0755, 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 * Mon Jul 22 2013 Pádraig Brady <pbrady@redhat.com> - 2013.1.2-4
292 - Add dependency on python-suds to support the netapp driver
293 - Add dependency on python-keystoneclient for auth token middleware
294 - Add dependency on python-oslo-config new in Grizzly
295 - Add dependency on qemu-img for volume creation from Glance images
296
297 * Wed Jul 17 2013 Pádraig Brady <pbrady@redhat.com> - 2013.1.2-2
298 - Avoid qpid exchange leaks
299
300 * Mon Jun 20 2013 Eric Harney <eharney@redhat.com> - 2013.1.2-1
301 - Update to Grizzly stable release 2
302
303 * Fri May 10 2013 Eric Harney <eharney@redhat.com> - 2013.1.1-1
304 - Update to Grizzly stable release 1
305
306 * Mon Apr 08 2013 Eric Harney <eharney@redhat.com> - 2013.1-2
307 - Backport fix for GlusterFS driver get_volume_stats
308 - Adjust to support sqlalchemy-0.8.0
309
310 * Thu Apr 04 2013 Eric Harney <eharney@redhat.com> - 2013.1-1
311 - Update to Grizzly final release
312
313 * Mon Mar 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc3
314 - Update to Grizzly RC3 release
315
316 * Mon Mar 25 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc2
317 - Update to Grizzly RC2 release
318
319 * Mon Mar 18 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.5.rc1
320 - Update to Grizzly RC1 release
321
322 * Tue Mar 05 2013 Pádraig Brady <P@draigBrady.com> - 2013.1-0.4.g3
323 - Add dependency on python-stevedore
324
325 * Wed Feb 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.2.g3
326 - Update to Grizzly milestone 3
327
328 * Thu Jan 10 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g2
329 - Update to Grizzly milestone 2
330
331 * Thu Dec 20 2012 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g1
332 - Update to Grizzly milestone 1
333
334 * Mon Dec 03 2012 Eric Harney <eharney@redhat.com> - 2012.2.1-1
335 - Update to Folsom stable release 1
336
337 * Wed Nov 14 2012 Eric Harney <eharney@redhat.com> - 2012.2-4
338 - Remove unused dependency on python-daemon
339
340 * Wed Oct 31 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-3
341 - Adjust to be compatible with python-migrate-0.6
342
343 * Wed Oct 24 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-2
344 - Initial Folsom release