-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenstack-glance.spec
328 lines (257 loc) · 11.6 KB
/
openstack-glance.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
Name: openstack-glance
Version: 2012.2
Release: 0.7.e4%{?dist}
Summary: OpenStack Image Service
Group: Applications/System
License: ASL 2.0
URL: http://glance.openstack.org
Source0: http://launchpad.net/glance/essex/essex-4/+download/glance-2012.1~e4.tar.gz
Source1: openstack-glance-api.service
Source2: openstack-glance-registry.service
Source3: openstack-glance.logrotate
#
# patches_base=essex-4
#
Patch0001: 0001-Don-t-access-the-net-while-building-docs.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-distutils-extra
BuildRequires: intltool
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(pre): shadow-utils
Requires: python-glance = %{version}-%{release}
%description
OpenStack Image Service (code-named Glance) provides discovery, registration,
and delivery services for virtual disk images. The Image Service API server
provides a standard REST interface for querying information about virtual disk
images stored in a variety of back-end stores, including OpenStack Object
Storage. Clients can register new virtual disk images with the Image Service,
query for information on publicly available disk images, and use the Image
Service's client library for streaming virtual disk images.
This package contains the API and registry servers.
%package -n python-glance
Summary: Glance Python libraries
Group: Applications/System
Requires: pysendfile
Requires: python-eventlet
Requires: python-httplib2
Requires: python-iso8601
Requires: python-kombu
Requires: python-migrate
Requires: python-paste-deploy
Requires: python-routes
Requires: python-sqlalchemy
Requires: python-webob
Requires: python-crypto
Requires: python-jsonschema
Requires: pyxattr
%description -n python-glance
OpenStack Image Service (code-named Glance) provides discovery, registration,
and delivery services for virtual disk images.
This package contains the glance Python library.
%package doc
Summary: Documentation for OpenStack Image Service
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildRequires: systemd-units
BuildRequires: python-sphinx
BuildRequires: graphviz
# Required to build module documents
BuildRequires: python-boto
BuildRequires: python-daemon
BuildRequires: python-eventlet
BuildRequires: python-gflags
BuildRequires: python-routes
BuildRequires: python-sqlalchemy
BuildRequires: python-webob
%description doc
OpenStack Image Service (code-named Glance) provides discovery, registration,
and delivery services for virtual disk images.
This package contains documentation files for glance.
%prep
%setup -q -n glance-%{version}
%patch0001 -p1
sed -i 's|\(sql_connection = sqlite:///\)\(glance.sqlite\)|\1%{_sharedstatedir}/glance/\2|' etc/glance-registry.conf
sed -i '/\/usr\/bin\/env python/d' glance/common/config.py glance/db/sqlalchemy/migrate_repo/manage.py
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
# Delete tests
rm -fr %{buildroot}%{python_sitelib}/tests
# Remove bin/glance if it exists (deprecated)
rm -f %{buildroot}%{_bindir}/glance
export PYTHONPATH="$( pwd ):$PYTHONPATH"
pushd doc
sphinx-build -b html source build/html
sphinx-build -b man source build/man
mkdir -p %{buildroot}%{_mandir}/man1
install -p -D -m 644 build/man/*.1 %{buildroot}%{_mandir}/man1/
popd
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
rm -f %{buildroot}%{_sysconfdir}/glance*.conf
rm -f %{buildroot}%{_sysconfdir}/glance*.ini
rm -f %{buildroot}%{_sysconfdir}/logging.cnf.sample
rm -f %{buildroot}%{_sysconfdir}/policy.json
rm -f %{buildroot}%{_sysconfdir}/schema-image.json
rm -f %{buildroot}/usr/share/doc/glance/README.rst
# Setup directories
install -d -m 755 %{buildroot}%{_sharedstatedir}/glance/images
# Config file
install -p -D -m 644 etc/glance-api.conf %{buildroot}%{_sysconfdir}/glance/glance-api.conf
install -p -D -m 644 etc/glance-api-paste.ini %{buildroot}%{_sysconfdir}/glance/glance-api-paste.ini
install -p -D -m 644 etc/glance-registry.conf %{buildroot}%{_sysconfdir}/glance/glance-registry.conf
install -p -D -m 644 etc/glance-registry-paste.ini %{buildroot}%{_sysconfdir}/glance/glance-registry-paste.ini
install -p -D -m 644 etc/glance-cache.conf %{buildroot}%{_sysconfdir}/glance/glance-cache.conf
install -p -D -m 644 etc/glance-scrubber.conf %{buildroot}%{_sysconfdir}/glance/glance-scrubber.conf
install -p -D -m 644 etc/policy.json %{buildroot}%{_sysconfdir}/glance/policy.json
install -p -D -m 644 etc/schema-image.json %{buildroot}%{_sysconfdir}/glance/schema-image.json
# Initscripts
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/openstack-glance-api.service
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/openstack-glance-registry.service
# Logrotate config
install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-glance
# Install pid directory
install -d -m 755 %{buildroot}%{_localstatedir}/run/glance
# Install log directory
install -d -m 755 %{buildroot}%{_localstatedir}/log/glance
%pre
getent group glance >/dev/null || groupadd -r glance -g 161
getent passwd glance >/dev/null || \
useradd -u 161 -r -g glance -d %{_sharedstatedir}/glance -s /sbin/nologin \
-c "OpenStack Glance Daemons" glance
exit 0
%post
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable openstack-glance-api.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable openstack-glance-registry.service > /dev/null 2>&1 || :
/bin/systemctl stop openstack-glance-api.service > /dev/null 2>&1 || :
/bin/systemctl stop openstack-glance-registry.service > /dev/null 2>&1 || :
fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart openstack-glance-api.service >/dev/null 2>&1 || :
/bin/systemctl try-restart openstack-glance-registry.service >/dev/null 2>&1 || :
fi
%files
%doc README.rst
%{_bindir}/glance-api
%{_bindir}/glance-control
%{_bindir}/glance-manage
%{_bindir}/glance-registry
%{_bindir}/glance-replicator
%{_bindir}/glance-cache-cleaner
%{_bindir}/glance-cache-manage
%{_bindir}/glance-cache-prefetcher
%{_bindir}/glance-cache-pruner
%{_bindir}/glance-scrubber
%{_unitdir}/openstack-glance-api.service
%{_unitdir}/openstack-glance-registry.service
%{_mandir}/man1/glance*.1.gz
%dir %{_sysconfdir}/glance
%config(noreplace) %{_sysconfdir}/glance/glance-api.conf
%config(noreplace) %{_sysconfdir}/glance/glance-api-paste.ini
%config(noreplace) %{_sysconfdir}/glance/glance-registry.conf
%config(noreplace) %{_sysconfdir}/glance/glance-registry-paste.ini
%config(noreplace) %{_sysconfdir}/glance/glance-cache.conf
%config(noreplace) %{_sysconfdir}/glance/glance-scrubber.conf
%config(noreplace) %{_sysconfdir}/glance/policy.json
%config(noreplace) %{_sysconfdir}/glance/schema-image.json
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-glance
%dir %attr(0755, glance, nobody) %{_sharedstatedir}/glance
%dir %attr(0755, glance, nobody) %{_localstatedir}/log/glance
%dir %attr(0755, glance, nobody) %{_localstatedir}/run/glance
%files -n python-glance
%doc README.rst
%{python_sitelib}/glance
%{python_sitelib}/glance-%{version}-*.egg-info
%files doc
%doc doc/build/html
%changelog
* Mon Aug 10 2012 Dan Prince <[email protected]> - 2012.2-0.7.f2
- Remove schema-access.json.
* Mon Jul 10 2012 Dan Prince <[email protected]> - 2012.2-0.7.f2
- Add bin/glance-replicator.
* Mon Jun 20 2012 Dan Prince <[email protected]> - 2012.2-0.7.f2
- Remove paste ini files for glance cache and scrubber.
* Mon Jun 12 2012 Dan Prince <[email protected]> - 2012.2-0.7.f2
- Add Requires for python-jsonschema.
- Add schema-access.json and schema-image.json config files.
* Mon Jun 8 2012 Dan Prince <[email protected]> - 2012.2-0.7.f2
- Update location of manage.py.
* Fri Mar 16 2012 Derek Higgins <[email protected]> - 2012.1-0.7.e4
- Remove glance-cache-queue-image
* Thu Mar 15 2012 Derek Higgins <[email protected]> - 2012.1-0.6.e4
- Minor change to 0001-Don-t-access-the-net-while-building-docs.patch
* Thu Mar 8 2012 Dan Prince <[email protected]> - 2012.1-0.5.e4
- Include config files for cache and scrubber.
* Fri Mar 2 2012 Russell Bryant <[email protected]> - 2012.1-0.5.e4
- Add python-iso8601 dependency.
* Fri Mar 2 2012 Russell Bryant <[email protected]> - 2012.1-0.4.e4
- Update to essex-4 milestone.
- Change python-xattr depdendency to pyxattr.
- Add pysendfile dependency.
* Mon Feb 13 2012 Russell Bryant <[email protected]> - 2012.1-0.3.e3
- Set PrivateTmp=true in glance systemd unit files. (rhbz#782505)
- Add dependency on python-crypto. (rhbz#789943)
* Mon Jan 30 2012 Russell Bryant <[email protected]> - 2012.1-0.2.e3
- Update how patches are managed to use update_patches.sh script
* Thu Jan 26 2012 Russell Bryant <[email protected]> - 2012.1-0.1.e3
- Update to essex-3 milestone
* Thu Jan 26 2012 Russell Bryant <[email protected]> - 2011.3.1-2
- Add python-migrate dependency to python-glance (rhbz#784891)
* Fri Jan 20 2012 Pádraig Brady <[email protected]> - 2011.3.1-1
- Update to 2011.3.1 final
* Wed Jan 18 2012 Mark McLoughlin <[email protected]> - 2011.3.1-0.2.1063%{?dist}
- Update to latest 2011.3.1 release candidate
* Tue Jan 17 2012 Mark McLoughlin <[email protected]> - 2011.3.1-0.1.1062%{?dist}
- Update to 2011.3.1 release candidate
- Includes 6 new patches from upstream
* Fri Jan 6 2012 Mark McLoughlin <[email protected]> - 2011.3-4
- Rebase to latest upstream stable/diablo branch adding ~20 patches
* Tue Dec 20 2011 David Busby <[email protected]> - 2011.3-3
- Depend on python-httplib2
* Tue Nov 22 2011 Pádraig Brady <[email protected]> - 2011.3-2
- Ensure the docs aren't built with the system glance module
- Ensure we don't access the net when building docs
- Depend on python-paste-deploy (#759512)
* Tue Sep 27 2011 Mark McLoughlin <[email protected]> - 2011.3-1
- Update to Diablo final
* Tue Sep 6 2011 Mark McLoughlin <[email protected]> - 2011.3-0.8.d4
- fix DB path in config
- add BR: intltool for distutils-extra
* Wed Aug 31 2011 Angus Salkeld <[email protected]> - 2011.3-0.7.d4
- Use the available man pages
- don't make service files executable
- delete unused files
- add BR: python-distutils-extra (#733610)
* Tue Aug 30 2011 Angus Salkeld <[email protected]> - 2011.3-0.6.d4
- Change from LSB scripts to systemd service files (#732689).
* Fri Aug 26 2011 Mark McLoughlin <[email protected]> - 2011.3-0.5.d4
- Update to diablo4 milestone
- Add logrotate config (#732691)
* Wed Aug 24 2011 Mark McLoughlin <[email protected]> - 2011.3-0.4.992bzr
- Update to latest upstream
- Use statically assigned uid:gid 161:161 (#732687)
* Mon Aug 22 2011 Mark McLoughlin <[email protected]> - 2011.3-0.3.987bzr
- Re-instate python2-devel BR (#731966)
* Mon Aug 22 2011 Mark McLoughlin <[email protected]> - 2011.3-0.2.987bzr
- Fix rpmlint warnings, reduce macro usage (#731966)
* Wed Aug 17 2011 Mark McLoughlin <[email protected]> - 2011.3-0.1.987bzr
- Update to latest upstream
- Require python-kombu for new notifiers support
* Mon Aug 8 2011 Mark McLoughlin <[email protected]> - 2011.3-0.1.967bzr
- Initial package from Alexander Sakhnov <[email protected]>
with cleanups by Mark McLoughlin