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