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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
Name: openstack-swift
Version: 1.0.2
Release: 5%{?dist}
Summary: OpenStack Object Storage (swift)
Group: Development/Languages
License: ASL 2.0
URL: http://launchpad.net/swift
Source0: http://launchpad.net/swift/1.0/%{version}/+download/swift-%{version}.tar.gz
Source1: %{name}-functions
Source2: %{name}-account.init
Source3: %{name}-auth.init
Source4: %{name}-container.init
Source5: %{name}-object.init
Source6: %{name}-proxy.init
Source20: %{name}-create-man-stubs.py
BuildRoot: %{_tmppath}/swift-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: dos2unix
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires: python-configobj
Requires: python-eventlet >= 0.9.8
Requires: python-greenlet >= 0.3.1
Requires: python-simplejson
Requires: python-webob
Requires: pyxattr
Requires(post): chkconfig
Requires(postun): initscripts
Requires(preun): chkconfig
Requires(pre): shadow-utils
%description
OpenStack Object Storage (swift) aggregates commodity servers to work together
in clusters for reliable, redundant, and large-scale storage of static objects.
Objects are written to multiple hardware devices in the data center, with the
OpenStack software responsible for ensuring data replication and integrity
across the cluster. Storage clusters can scale horizontally by adding new nodes,
which are automatically configured. Should a node fail, OpenStack works to
replicate its content from other active nodes. Because OpenStack uses software
logic to ensure data replication and distribution across different devices,
inexpensive commodity hard drives and servers can be used in lieu of more
expensive equipment.
%package account
Summary: A swift account server
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%description account
OpenStack Object Storage (swift) aggregates commodity servers to work together
in clusters for reliable, redundant, and large-scale storage of static objects.
This package contains the %{name} account server.
%package auth
Summary: A swift auth server
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%description auth
OpenStack Object Storage (swift) aggregates commodity servers to work together
in clusters for reliable, redundant, and large-scale storage of static objects.
This package contains the %{name} auth server.
%package container
Summary: A swift container server
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%description container
OpenStack Object Storage (swift) aggregates commodity servers to work together
in clusters for reliable, redundant, and large-scale storage of static objects.
This package contains the %{name} container server.
%package object
Summary: A swift object server
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%description object
OpenStack Object Storage (swift) aggregates commodity servers to work together
in clusters for reliable, redundant, and large-scale storage of static objects.
This package contains the %{name} object server.
%package proxy
Summary: A swift proxy server
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%description proxy
OpenStack Object Storage (swift) aggregates commodity servers to work together
in clusters for reliable, redundant, and large-scale storage of static objects.
This package contains the %{name} proxy server.
%package doc
Summary: Documentation for %{name}
Group: Documentation
BuildRequires: python-sphinx
# Required for generating docs
BuildRequires: python-eventlet
BuildRequires: python-simplejson
BuildRequires: python-webob
BuildRequires: pyxattr
%description doc
OpenStack Object Storage (swift) aggregates commodity servers to work together
in clusters for reliable, redundant, and large-scale storage of static objects.
This package contains documentation files for %{name}.
%prep
%setup -q -n swift-%{version}
# Fix wrong-file-end-of-line-encoding warning
dos2unix LICENSE
%build
%{__python} setup.py build
# Build docs
pushd doc; make html; popd
# Fix hidden-file-or-dir warning
rm doc/build/html/.buildinfo
# Build man stubs
%{__python} %{SOURCE20} --mandir=./man
%install
rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
# Init helper functions
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_datarootdir}/%{name}/functions
# Init scripts
install -p -D -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/%{name}-account
install -p -D -m 755 %{SOURCE3} %{buildroot}%{_initrddir}/%{name}-auth
install -p -D -m 755 %{SOURCE4} %{buildroot}%{_initrddir}/%{name}-container
install -p -D -m 755 %{SOURCE5} %{buildroot}%{_initrddir}/%{name}-object
install -p -D -m 755 %{SOURCE6} %{buildroot}%{_initrddir}/%{name}-proxy
# Install man stubs
for name in $( ls ./man ); do
mkdir -p "%{buildroot}%{_mandir}/$name"
cp "./man/$name/"*.gz "%{buildroot}%{_mandir}/$name"
done
# Remove tests
rm -fr %{buildroot}/%{python_sitelib}/test
# Misc other
install -d -m 755 %{buildroot}%{_sysconfdir}/swift
install -d -m 755 %{buildroot}%{_sysconfdir}/swift/account-server
install -d -m 755 %{buildroot}%{_sysconfdir}/swift/auth-server
install -d -m 755 %{buildroot}%{_sysconfdir}/swift/container-server
install -d -m 755 %{buildroot}%{_sysconfdir}/swift/object-server
install -d -m 755 %{buildroot}%{_sysconfdir}/swift/proxy-server
# Install pid directory
install -d -m 755 %{buildroot}%{_localstatedir}/run/swift
install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/account-server
install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/auth-server
install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/container-server
install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/object-server
install -d -m 755 %{buildroot}%{_localstatedir}/run/swift/proxy-server
%clean
rm -rf %{buildroot}
%pre
getent group swift >/dev/null || groupadd -r swift
getent passwd swift >/dev/null || \
useradd -r -g swift -d %{_sharedstatedir}/swift -s /sbin/nologin \
-c "OpenStack Swift Daemons" swift
exit 0
%post account
/sbin/chkconfig --add swift-account
%preun account
if [ $1 = 0 ] ; then
/sbin/service swift-account stop >/dev/null 2>&1
/sbin/chkconfig --del swift-account
fi
%postun account
if [ "$1" -ge "1" ] ; then
/sbin/service swift-account condrestart >/dev/null 2>&1 || :
fi
%post auth
/sbin/chkconfig --add swift-auth
%preun auth
if [ $1 = 0 ] ; then
/sbin/service swift-auth stop >/dev/null 2>&1
/sbin/chkconfig --del swift-auth
fi
%postun auth
if [ "$1" -ge "1" ] ; then
/sbin/service swift-auth condrestart >/dev/null 2>&1 || :
fi
%post container
/sbin/chkconfig --add swift-container
%preun container
if [ $1 = 0 ] ; then
/sbin/service swift-container stop >/dev/null 2>&1
/sbin/chkconfig --del swift-container
fi
%postun container
if [ "$1" -ge "1" ] ; then
/sbin/service swift-container condrestart >/dev/null 2>&1 || :
fi
%post object
/sbin/chkconfig --add swift-object
%preun object
if [ $1 = 0 ] ; then
/sbin/service swift-object stop >/dev/null 2>&1
/sbin/chkconfig --del swift-object
fi
%postun object
if [ "$1" -ge "1" ] ; then
/sbin/service swift-object condrestart >/dev/null 2>&1 || :
fi
%post proxy
/sbin/chkconfig --add swift-proxy
%preun proxy
if [ $1 = 0 ] ; then
/sbin/service swift-proxy stop >/dev/null 2>&1
/sbin/chkconfig --del swift-proxy
fi
%postun proxy
if [ "$1" -ge "1" ] ; then
/sbin/service swift-proxy condrestart >/dev/null 2>&1 || :
fi
%files
%defattr(-,root,root,-)
%doc AUTHORS LICENSE README
%dir %{_datarootdir}/%{name}/functions
%dir %attr(0755, swift, root) %{_localstatedir}/run/swift
%dir %{_sysconfdir}/swift
%dir %{python_sitelib}/swift
%{_bindir}/st
%{_bindir}/swift-account-audit
%{_bindir}/swift-drive-audit
%{_bindir}/swift-get-nodes
%{_bindir}/swift-init
%{_bindir}/swift-ring-builder
%{_bindir}/swift-stats-populate
%{_bindir}/swift-stats-report
%{_mandir}/man8/st.8.gz
%{_mandir}/man8/swift-account-audit.8.gz
%{_mandir}/man8/swift-drive-audit.8.gz
%{_mandir}/man8/swift-get-nodes.8.gz
%{_mandir}/man8/swift-init.8.gz
%{_mandir}/man8/swift-ring-builder.8.gz
%{_mandir}/man8/swift-stats-populate.8.gz
%{_mandir}/man8/swift-stats-report.8.gz
%{python_sitelib}/swift/*.py*
%{python_sitelib}/swift/common
%{python_sitelib}/swift-%{version}-*.egg-info
%files account
%defattr(-,root,root,-)
%doc etc/account-server.conf-sample
%dir %{_initrddir}/%{name}-account
%dir %attr(0755, swift, root) %{_localstatedir}/run/swift/account-server
%dir %{_sysconfdir}/swift/account-server
%{_bindir}/swift-account-auditor
%{_bindir}/swift-account-reaper
%{_bindir}/swift-account-replicator
%{_bindir}/swift-account-server
%{_mandir}/man8/swift-account-auditor.8.gz
%{_mandir}/man8/swift-account-reaper.8.gz
%{_mandir}/man8/swift-account-replicator.8.gz
%{_mandir}/man8/swift-account-server.8.gz
%{python_sitelib}/swift/account
%files auth
%defattr(-,root,root,-)
%doc etc/auth-server.conf-sample
%dir %{_initrddir}/%{name}-auth
%dir %attr(0755, swift, root) %{_localstatedir}/run/swift/auth-server
%dir %{_sysconfdir}/swift/auth-server
%{_bindir}/swift-auth-create-account
%{_bindir}/swift-auth-recreate-accounts
%{_bindir}/swift-auth-server
%{_mandir}/man8/swift-auth-create-account.8.gz
%{_mandir}/man8/swift-auth-recreate-accounts.8.gz
%{_mandir}/man8/swift-auth-server.8.gz
%{python_sitelib}/swift/auth
%files container
%defattr(-,root,root,-)
%doc etc/container-server.conf-sample
%dir %{_initrddir}/%{name}-container
%dir %attr(0755, swift, root) %{_localstatedir}/run/swift/container-server
%dir %{_sysconfdir}/swift/container-server
%{_bindir}/swift-container-auditor
%{_bindir}/swift-container-server
%{_bindir}/swift-container-replicator
%{_bindir}/swift-container-updater
%{_mandir}/man8/swift-container-auditor.8.gz
%{_mandir}/man8/swift-container-server.8.gz
%{_mandir}/man8/swift-container-replicator.8.gz
%{_mandir}/man8/swift-container-updater.8.gz
%{python_sitelib}/swift/container
%files object
%defattr(-,root,root,-)
%doc etc/account-server.conf-sample etc/rsyncd.conf-sample
%dir %{_initrddir}/%{name}-object
%dir %attr(0755, swift, root) %{_localstatedir}/run/swift/object-server
%dir %{_sysconfdir}/swift/object-server
%{_bindir}/swift-object-auditor
%{_bindir}/swift-object-info
%{_bindir}/swift-object-replicator
%{_bindir}/swift-object-server
%{_bindir}/swift-object-updater
%{_mandir}/man8/swift-object-auditor.8.gz
%{_mandir}/man8/swift-object-info.8.gz
%{_mandir}/man8/swift-object-replicator.8.gz
%{_mandir}/man8/swift-object-server.8.gz
%{_mandir}/man8/swift-object-updater.8.gz
%{python_sitelib}/swift/obj
%files proxy
%defattr(-,root,root,-)
%doc etc/proxy-server.conf-sample
%dir %{_initrddir}/%{name}-proxy
%dir %attr(0755, swift, root) %{_localstatedir}/run/swift/proxy-server
%dir %{_sysconfdir}/swift/proxy-server
%{_bindir}/swift-proxy-server
%{_mandir}/man8/swift-proxy-server.8.gz
%{python_sitelib}/swift/proxy
%files doc
%defattr(-,root,root,-)
%doc LICENSE doc/build/html
%changelog
* Sun Aug 08 2010 Silas Sewell <silas@sewell.ch> - 1.0.2-5
- Update for new Python macro guidelines
- Use dos2unix instead of sed
- Make gecos field more descriptive
* Wed Jul 28 2010 Silas Sewell <silas@sewell.ch> - 1.0.2-4
- Rename to openstack-swift
* Wed Jul 28 2010 Silas Sewell <silas@sewell.ch> - 1.0.2-3
- Fix return value in swift-functions
* Tue Jul 27 2010 Silas Sewell <silas@sewell.ch> - 1.0.2-2
- Add swift user
- Update init scripts
* Sun Jul 18 2010 Silas Sewell <silas@sewell.ch> - 1.0.2-1
- Initial build
|