1 %global with_doc %{!?_without_doc:1}%{?_without_doc:0}
5 Release: 0.4.g3%{?dist}
6 Summary: OpenStack Volume service
8 Group: Applications/System
10 URL: http://www.openstack.org/software/openstack-storage/
11 Source0: https://launchpad.net/cinder/grizzly/grizzly-3/+download/cinder-2013.1.g3.tar.gz
13 Source2: cinder.logrotate
14 Source3: cinder-tgt.conf
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
23 Source20: cinder-sudoers
26 # patches_base=grizzly-3
28 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
30 # This is EPEL specific and not upstream
31 Patch100: openstack-cinder-newdeps.patch
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
45 Requires: openstack-utils
46 Requires: python-cinder = %{version}-%{release}
49 Requires: python-cinderclient
51 Requires(post): chkconfig
52 Requires(postun): initscripts
53 Requires(preun): chkconfig
54 Requires(pre): shadow-utils
57 Requires: scsi-target-utils
60 OpenStack Volume (codename Cinder) provides services to manage and
61 access block storage volumes for use by Virtual Machine instances.
64 %package -n python-cinder
65 Summary: OpenStack Volume Python libraries
66 Group: Applications/System
70 Requires: MySQL-python
72 Requires: python-paramiko
75 Requires: python-kombu
76 Requires: python-amqplib
78 Requires: python-eventlet
79 Requires: python-greenlet
80 Requires: python-iso8601
81 Requires: python-netaddr
83 Requires: python-anyjson
84 Requires: python-cheetah
85 Requires: python-stevedore
87 Requires: python-sqlalchemy0.7
88 Requires: python-migrate
90 Requires: python-paste-deploy1.5
91 Requires: python-routes1.12
92 Requires: python-webob1.0
94 Requires: python-glanceclient >= 1:0
96 %description -n python-cinder
97 OpenStack Volume (codename Cinder) provides services to manage and
98 access block storage volumes for use by Virtual Machine instances.
100 This package contains the cinder Python library.
104 Summary: Documentation for OpenStack Volume
107 Requires: %{name} = %{version}-%{release}
109 BuildRequires: graphviz
111 # Required to build module documents
112 BuildRequires: python-eventlet
113 BuildRequires: python-routes1.12
114 BuildRequires: python-sqlalchemy0.7
115 BuildRequires: python-webob1.0
116 # while not strictly required, quiets the build down when building docs.
117 BuildRequires: python-migrate, python-iso8601
120 OpenStack Volume (codename Cinder) provides services to manage and
121 access block storage volumes for use by Virtual Machine instances.
123 This package contains documentation files for cinder.
127 %setup -q -n cinder-%{version}.g3
134 find . \( -name .gitignore -o -name .placeholder \) -delete
136 find cinder -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
138 # TODO: Have the following handle multi line entries
139 sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
143 # Move authtoken configuration out of paste.ini
144 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_tenant_name
145 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_user
146 openstack-config --del etc/cinder/api-paste.ini filter:authtoken admin_password
147 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_host
148 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_port
149 openstack-config --del etc/cinder/api-paste.ini filter:authtoken auth_protocol
151 %{__python} setup.py build
154 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
156 # docs generation requires everything to be installed first
157 export PYTHONPATH="$( pwd ):$PYTHONPATH"
162 SPHINX_DEBUG=1 sphinx-1.0-build -b html source build/html
163 # Fix hidden-file-or-dir warnings
164 rm -fr build/html/.doctrees build/html/.buildinfo
167 # Create dir link to avoid a sphinx-build exception
168 mkdir -p build/man/.doctrees/
169 ln -s . build/man/.doctrees/man
170 SPHINX_DEBUG=1 sphinx-1.0-build -b man -c source source/man build/man
171 mkdir -p %{buildroot}%{_mandir}/man1
172 install -p -D -m 644 build/man/*.1 %{buildroot}%{_mandir}/man1/
177 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder
178 install -d -m 755 %{buildroot}%{_sharedstatedir}/cinder/tmp
179 install -d -m 755 %{buildroot}%{_localstatedir}/log/cinder
181 # Install config files
182 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder
183 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/cinder/cinder.conf
184 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder/volumes
185 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt/conf.d/cinder.conf
186 install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/rootwrap.conf
187 install -p -D -m 640 etc/cinder/api-paste.ini %{buildroot}%{_sysconfdir}/cinder/api-paste.ini
188 install -p -D -m 640 etc/cinder/policy.json %{buildroot}%{_sysconfdir}/cinder/policy.json
190 # Install initscripts for services
191 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/openstack-cinder-api
192 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-cinder-scheduler
193 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-cinder-volume
196 install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/cinder
199 install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-cinder
201 # Install pid directory
202 install -d -m 755 %{buildroot}%{_localstatedir}/run/cinder
204 # Install upstart jobs examples
205 install -d -m 755 %{buildroot}%{_datadir}/cinder
206 install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/cinder/
207 install -p -m 644 %{SOURCE110} %{buildroot}%{_datadir}/cinder/
208 install -p -m 644 %{SOURCE120} %{buildroot}%{_datadir}/cinder/
210 # Install rootwrap files in /usr/share/cinder/rootwrap
211 mkdir -p %{buildroot}%{_datarootdir}/cinder/rootwrap/
212 install -p -D -m 644 etc/cinder/rootwrap.d/* %{buildroot}%{_datarootdir}/cinder/rootwrap/
214 # Remove unneeded in production stuff
215 rm -f %{buildroot}%{_bindir}/cinder-debug
216 rm -fr %{buildroot}%{python_sitelib}/cinder/tests/
217 rm -fr %{buildroot}%{python_sitelib}/run_tests.*
218 rm -f %{buildroot}/usr/share/doc/cinder/README*
221 getent group cinder >/dev/null || groupadd -r cinder --gid 165
222 if ! getent passwd cinder >/dev/null; then
223 useradd -u 165 -r -g cinder -G cinder,nobody -d %{_sharedstatedir}/cinder -s /sbin/nologin -c "OpenStack Cinder Daemons" cinder
228 if [ $1 -eq 1 ] ; then
229 # Initial installation
230 for svc in volume api scheduler; do
231 /sbin/chkconfig --add openstack-cinder-$svc
236 if [ $1 -eq 0 ] ; then
237 for svc in volume api scheduler; do
238 /sbin/service openstack-cinder-${svc} stop > /dev/null 2>&1
239 /sbin/chkconfig --del openstack-cinder-${svc}
244 if [ $1 -ge 1 ] ; then
245 # Package upgrade, not uninstall
246 for svc in volume api scheduler; do
247 /sbin/service openstack-cinder-${svc} condrestart > /dev/null 2>&1 || :
254 %dir %{_sysconfdir}/cinder
255 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/cinder.conf
256 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/api-paste.ini
257 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/rootwrap.conf
258 %config(noreplace) %attr(-, root, cinder) %{_sysconfdir}/cinder/policy.json
259 %config(noreplace) %{_sysconfdir}/logrotate.d/openstack-cinder
260 %config(noreplace) %{_sysconfdir}/sudoers.d/cinder
261 %config(noreplace) %{_sysconfdir}/tgt/conf.d/cinder.conf
263 %dir %attr(0755, cinder, root) %{_localstatedir}/log/cinder
264 %dir %attr(0755, cinder, root) %{_localstatedir}/run/cinder
265 %dir %attr(0755, cinder, root) %{_sysconfdir}/cinder/volumes
268 %{_initrddir}/openstack-cinder-*
269 %{_datarootdir}/cinder
270 %{_mandir}/man1/cinder*.1.gz
272 %defattr(-, cinder, cinder, -)
273 %dir %{_sharedstatedir}/cinder
274 %dir %{_sharedstatedir}/cinder/tmp
276 %files -n python-cinder
278 %{python_sitelib}/cinder
279 %{python_sitelib}/cinder-%{version}*.egg-info
287 * Tue Mar 05 2013 Pádraig Brady <P@draigBrady.com> - 2013.1.0.4.g3
288 - Add dependency on python-stevedore
290 * Wed Feb 27 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.2.g3
291 - Update to Grizzly milestone 3
293 * Thu Jan 10 2013 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g2
294 - Update to Grizzly milestone 2
296 * Thu Dec 20 2012 Eric Harney <eharney@redhat.com> - 2013.1-0.1.g1
297 - Update to Grizzly milestone 1
299 * Mon Dec 03 2012 Eric Harney <eharney@redhat.com> - 2012.2.1-1
300 - Update to Folsom stable release 1
302 * Wed Nov 14 2012 Eric Harney <eharney@redhat.com> - 2012.2-4
303 - Remove unused dependency on python-daemon
305 * Wed Oct 31 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-3
306 - Adjust to be compatible with python-migrate-0.6
308 * Wed Oct 24 2012 Pádraig Brady <P@draigBrady.com> - 2012.2-2
309 - Initial Folsom release