forked from beaker-project/beaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
beaker.spec
505 lines (458 loc) · 18.5 KB
/
beaker.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
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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
%if 0%{?fedora} >= 30 || 0%{?rhel} >= 8
%bcond_without python3
%else
%bcond_with python3
%endif
%global _lc_services beaker-proxy beaker-provision beaker-watchdog beaker-transfer
# This will not necessarily match the RPM Version if the real version number is
# not representable in RPM. For example, a release candidate might be 0.15.0rc1
# but that is not usable for the RPM Version because it sorts higher than
# 0.15.0, so the RPM will have Version 0.15.0 and Release 0.rc1 in that case.
%global upstream_version 28.2
Name: beaker
Version: 28.2
Release: 1%{?dist}
Summary: Full-stack software and hardware integration testing system
Group: Applications/Internet
License: GPLv2+ and BSD
URL: https://beaker-project.org/
Source0: https://beaker-project.org/releases/%{name}-%{upstream_version}.tar.xz
# Third-party JS/CSS libraries which are built into Beaker's generated JS/CSS
# (these are submodules in Beaker's git tree, the commit hashes here should
# correspond to the submodule commits)
Source1: https://github.com/twbs/bootstrap/archive/d9b502dfb876c40b0735008bac18049c7ee7b6d2/bootstrap-d9b502dfb876c40b0735008bac18049c7ee7b6d2.tar.gz
Source2: https://github.com/FortAwesome/Font-Awesome/archive/a8386aae19e200ddb0f6845b5feeee5eb7013687/font-awesome-a8386aae19e200ddb0f6845b5feeee5eb7013687.tar.gz
Source3: https://github.com/twitter/typeahead.js/archive/2bd1119ecdd5ed4bb6b78c83b904d70adc49e023/typeahead.js-2bd1119ecdd5ed4bb6b78c83b904d70adc49e023.tar.gz
Source4: https://github.com/jashkenas/underscore/archive/edbf2952c2b71f81c6449aef384bdf233a0d63bc/underscore-edbf2952c2b71f81c6449aef384bdf233a0d63bc.tar.gz
Source5: https://github.com/jashkenas/backbone/archive/53f77901a4ea9c7cf75d3db93ddddf491998d90f/backbone-53f77901a4ea9c7cf75d3db93ddddf491998d90f.tar.gz
Source6: https://github.com/moment/moment/archive/604c7942de38749e768ff8e327301ea6917c7c73/moment-604c7942de38749e768ff8e327301ea6917c7c73.tar.gz
Source7: https://github.com/silviomoreto/bootstrap-select/archive/005d84efe1679d3c83f02bcd4a8cc5f89d500afc/bootstrap-select-005d84efe1679d3c83f02bcd4a8cc5f89d500afc.tar.gz
Source8: https://github.com/wyuenho/backgrid/archive/ff4b033d6f33b3af543e735869b225f4ac984acf/backgrid-ff4b033d6f33b3af543e735869b225f4ac984acf.tar.gz
Source9: https://github.com/wyuenho/backbone-pageable/archive/61912d577bb5289a80654e89deeb8dc505f283bd/backbone-pageable-61912d577bb5289a80654e89deeb8dc505f283bd.tar.gz
Source10: https://github.com/medialize/URI.js/archive/40a89137c5bc297f73467290c39ca596f891dcb9/URI.js-40a89137c5bc297f73467290c39ca596f891dcb9.tar.gz
Source11: https://github.com/makeusabrew/bootbox/archive/ed5c62a02ab1eb512c38f4be1d0f6774c51a85c6/bootbox-ed5c62a02ab1eb512c38f4be1d0f6774c51a85c6.tar.gz
Source12: https://github.com/ifightcrime/bootstrap-growl/archive/eba6d7685c842f83764290c9ab5e82f7d4ffea22/bootstrap-growl-eba6d7685c842f83764290c9ab5e82f7d4ffea22.tar.gz
Source13: https://github.com/eternicode/bootstrap-datepicker/archive/b374f23971817d507bded0dc16892e87a6d2fe42/bootstrap-datepicker-b374f23971817d507bded0dc16892e87a6d2fe42.tar.gz
Source14: https://github.com/chjj/marked/archive/2b5802f258c5e23e48366f2377fbb4c807f47658/marked-2b5802f258c5e23e48366f2377fbb4c807f47658.tar.gz
Source15: https://github.com/jsmreese/moment-duration-format/archive/8d0bf29a1eab180cb83d0f13f93f6974faedeafd/moment-duration-format-8d0bf29a1eab180cb83d0f13f93f6974faedeafd.tar.gz
BuildArch: noarch
BuildRequires: make
BuildRequires: python3-setuptools
BuildRequires: python3-nose
BuildRequires: python3-mock
BuildRequires: python3-devel
BuildRequires: python3-docutils
BuildRequires: python3-sphinx
%package common
Summary: Common components for Beaker packages
Group: Applications/Internet
Provides: %{name} = %{version}-%{release}
Obsoletes: %{name} < 0.17.0-1
%package client
Summary: Command-line client for interacting with Beaker
Group: Applications/Internet
Requires: %{name}-common = %{version}-%{release}
# setup.py uses pkg-config to find the right installation paths
BuildRequires: pkgconfig(bash-completion)
# These client dependencies are needed in build because of sphinx
BuildRequires: python3-gssapi
BuildRequires: python3-lxml
BuildRequires: python3-prettytable
BuildRequires: python3-libxml2
Requires: python3-six
Requires: python3-setuptools
Requires: python3-gssapi
Requires: python3-lxml
Requires: python3-requests
Requires: python3-libxml2
Requires: python3-prettytable
Requires: python3-jinja2
# beaker-wizard was moved from rhts-devel to here in 4.52
Conflicts: rhts-devel < 4.52
%if %{without python3}
%package server
Summary: Beaker scheduler and web interface
Group: Applications/Internet
Requires: %{name}-common = %{version}-%{release}
BuildRequires: python-kid
# These runtime dependencies are needed at build time as well, because
# the unit tests and Sphinx autodoc import the server code as part of the
# build process.
BuildRequires: createrepo_c
BuildRequires: ipxe-bootimgs
BuildRequires: syslinux
BuildRequires: mtools
Requires: createrepo_c
Requires: ipxe-bootimgs
Requires: syslinux
Requires: mtools
Requires: intltool
Requires: crontabs
Requires: mod_wsgi
Requires: httpd
Requires: dnf
Requires: nodejs-less >= 1.7
Requires: /usr/bin/cssmin
Requires: /usr/bin/uglifyjs
BuildRequires: python-requests
BuildRequires: TurboGears >= 1.1.3
BuildRequires: python-turbojson
BuildRequires: python-sqlalchemy >= 0.9
BuildRequires: python-lxml
BuildRequires: python-ldap
BuildRequires: python-rdflib >= 3.2.0
BuildRequires: python-TurboMail >= 3.0
BuildRequires: python-pwquality
BuildRequires: rpm-python
BuildRequires: python-netaddr
BuildRequires: python-itsdangerous
BuildRequires: python-decorator
BuildRequires: python-webassets
BuildRequires: python-flask
BuildRequires: python-markdown
BuildRequires: python-passlib
BuildRequires: python-alembic
BuildRequires: python-daemon
BuildRequires: python-futures
Requires: TurboGears >= 1.1.3
Requires: python-turbojson
Requires: python-sqlalchemy >= 0.9
Requires: python-decorator
Requires: python-lxml
Requires: python-ldap
Requires: python-rdflib >= 3.2.0
Requires: python-daemon
Requires: python-lockfile >= 0.9
Requires: python-gssapi
Requires: python-TurboMail >= 3.0
Requires: python-pwquality
Requires: python-jinja2
Requires: python-netaddr
Requires: python-requests >= 1.0
Requires: python-requests-kerberos
Requires: python-itsdangerous
Requires: python-decorator
Requires: python-flask
Requires: python-markdown
Requires: python-webassets
Requires: python-passlib
Requires: python-alembic
Requires: python-futures
BuildRequires: systemd
BuildRequires: pkgconfig(systemd)
Requires: systemd-units
Requires(post): systemd
Requires(pre): systemd
Requires(postun): systemd
%endif
%if %{without python3}
%package integration-tests
Summary: Integration tests for Beaker
Group: Applications/Internet
Requires: %{name}-common = %{version}-%{release}
Requires: %{name}-server = %{version}-%{release}
Requires: %{name}-client = %{version}-%{release}
Requires: %{name}-lab-controller = %{version}-%{release}
Requires: Xvfb
Requires: firefox
Requires: lsof
Requires: openldap-servers
Requires: nss_wrapper
# old style Python package names
Requires: python-nose >= 0.10
Requires: python-requests >= 1.0
Requires: python-requests-kerberos
Requires: python-gunicorn
Requires: python-mock
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1358533
Requires: python-cssselect
%endif
%if %{without python3}
%package lab-controller
Summary: Daemons for controlling a Beaker lab
Group: Applications/Internet
Requires: %{name}-common = %{version}-%{release}
Requires: python
Requires: crontabs
Requires: httpd
Requires: syslinux
Requires: fence-agents
Requires: ipmitool
Requires: wsmancli
Requires: /usr/bin/virsh
Requires: telnet
Requires: dnf
Requires: sudo
# old style Python package names
# These LC dependencies are needed in build due to tests
BuildRequires: python-lxml
BuildRequires: python-gevent >= 1.0
Requires: python-cpio
Requires: python-setuptools
Requires: python-lxml
Requires: python-gssapi
Requires: python-gevent >= 1.0
Requires: python-daemon
Requires: python-werkzeug
Requires: python-flask
BuildRequires: systemd
BuildRequires: pkgconfig(systemd)
Requires: systemd-units
Requires(post): systemd
Requires(pre): systemd
Requires(postun): systemd
%endif
%if %{without python3}
%package lab-controller-addDistro
Summary: Optional hooks for distro import on Beaker lab controllers
Group: Applications/Internet
Requires: %{name}-common = %{version}-%{release}
Requires: %{name}-lab-controller = %{version}-%{release}
Requires: %{name}-client = %{version}-%{release}
%endif
%description
Beaker is a full stack software and hardware integration testing system, with
the ability to manage a globally distributed network of test labs.
%description common
Python modules which are used by other Beaker packages.
%description client
The bkr client is a command-line tool for interacting with Beaker servers. You
can use it to submit Beaker jobs, fetch results, and perform many other tasks.
%if %{without python3}
%description server
This package provides the central server components for Beaker, which
consist of:
* a Python web application, providing services to remote lab controllers as
well as a web interface for Beaker users;
* the beakerd scheduling daemon, which schedules recipes on systems; and
* command-line tools for managing a Beaker installation.
%endif
%if %{without python3}
%description integration-tests
This package contains integration tests for Beaker, which require a running
database and Beaker server.
%endif
%if %{without python3}
%description lab-controller
The lab controller daemons connect to a central Beaker server in order to
manage a local lab of test systems.
The daemons and associated lab controller tools:
* set up netboot configuration files
* control power for test systems
* collect logs and results from test runs
* track distros available from the lab's local mirror
%endif
%if %{without python3}
%description lab-controller-addDistro
addDistro.sh can be called after distros have been imported into Beaker. You
can install this on your lab controller to automatically launch jobs against
newly imported distros.
%endif
%prep
%setup -q -n %{name}-%{upstream_version}
tar -C Server/assets/bootstrap --strip-components=1 -xzf %{SOURCE1}
tar -C Server/assets/font-awesome --strip-components=1 -xzf %{SOURCE2}
tar -C Server/assets/typeahead.js --strip-components=1 -xzf %{SOURCE3}
tar -C Server/assets/underscore --strip-components=1 -xzf %{SOURCE4}
tar -C Server/assets/backbone --strip-components=1 -xzf %{SOURCE5}
tar -C Server/assets/moment --strip-components=1 -xzf %{SOURCE6}
tar -C Server/assets/bootstrap-select --strip-components=1 -xzf %{SOURCE7}
tar -C Server/assets/backgrid --strip-components=1 -xzf %{SOURCE8}
tar -C Server/assets/backbone-pageable --strip-components=1 -xzf %{SOURCE9}
tar -C Server/assets/URI.js --strip-components=1 -xzf %{SOURCE10}
tar -C Server/assets/bootbox --strip-components=1 -xzf %{SOURCE11}
tar -C Server/assets/bootstrap-growl --strip-components=1 -xzf %{SOURCE12}
tar -C Server/assets/bootstrap-datepicker --strip-components=1 -xzf %{SOURCE13}
tar -C Server/assets/marked --strip-components=1 -xzf %{SOURCE14}
tar -C Server/assets/moment-duration-format --strip-components=1 -xzf %{SOURCE15}
%build
export BKR_PY3=%{with python3}
make
%install
# RHEL 8 python3-nose removed unversioned executables
%if 0%{?rhel} >= 8
ln -sf %{_bindir}/nosetests-%{python3_version} %{buildroot}/nosetests-3
%endif
export BKR_PY3=%{with python3}
DESTDIR=%{buildroot} make install
%if %{without python3}
# Newer RPM fails if site.less doesn't exist, even though it's marked %%ghost
# and therefore is not included in the RPM. Seems like an RPM bug...
ln -s /dev/null %{buildroot}%{_datadir}/bkr/server/assets/site.less
%endif
%check
%if 0%{?rhel} >= 8
export PATH=%{buildroot}:$PATH
%endif
export BKR_PY3=%{with python3}
make check
%if 0%{?rhel} >= 8
unlink %{buildroot}/nosetests-3
%endif
%if %{without python3}
%post server
%systemd_post beakerd.service
# Migrate ConcurrentLogHandler -> syslog
rm -f %{_localstatedir}/log/%{name}/*.lock >/dev/null 2>&1 || :
chown root:root %{_localstatedir}/log/%{name}/*.log >/dev/null 2>&1 || :
chmod go-w %{_localstatedir}/log/%{name}/*.log >/dev/null 2>&1 || :
# Restart rsyslog so that it notices the config which we ship
/sbin/service rsyslog condrestart >/dev/null 2>&1 || :
# Create symlink for site.less (this is ghosted so that other packages can overwrite it)
if [ ! -f %{_datadir}/bkr/server/assets/site.less ] ; then
ln -s /dev/null %{_datadir}/bkr/server/assets/site.less || :
fi
%endif
%if %{without python3}
%post lab-controller
%systemd_post %{_lc_services}
# Migrate ConcurrentLogHandler -> syslog
rm -f %{_localstatedir}/log/%{name}/*.lock >/dev/null 2>&1 || :
chown root:root %{_localstatedir}/log/%{name}/*.log >/dev/null 2>&1 || :
chmod go-w %{_localstatedir}/log/%{name}/*.log >/dev/null 2>&1 || :
# Restart rsyslog so that it notices the config which we ship
/sbin/service rsyslog condrestart >/dev/null 2>&1 || :
%endif
%if %{without python3}
%postun server
%systemd_postun_with_restart beakerd.service
%endif
%if %{without python3}
%postun lab-controller
%systemd_postun_with_restart %{_lc_services}
%endif
%if %{without python3}
%preun server
%systemd_preun beakerd.service
%endif
%if %{without python3}
%preun lab-controller
%systemd_preun %{_lc_services}
%endif
%files common
%if %{with python3}
%dir %{python3_sitelib}/bkr/
%{python3_sitelib}/bkr/__init__.py*
%{python3_sitelib}/bkr/common/
%{python3_sitelib}/bkr/log.py*
%{python3_sitelib}/bkr/__pycache__/*
%{python3_sitelib}/%{name}_common-*.egg-info/
%else
%dir %{python2_sitelib}/bkr/
%{python2_sitelib}/bkr/__init__.py*
%{python2_sitelib}/bkr/common/
%{python2_sitelib}/bkr/log.py*
%{python2_sitelib}/beaker_common-*.egg-info/
%endif
%doc COPYING
%if %{without python3}
%files server
%dir %{_sysconfdir}/%{name}
%doc documentation/_build/text/whats-new/
%{python2_sitelib}/bkr/server/
%{python2_sitelib}/beaker_server-*-nspkg.pth
%{python2_sitelib}/beaker_server-*.egg-info/
%{_bindir}/beaker-init
%{_bindir}/beaker-usage-reminder
%{_bindir}/beaker-log-delete
%{_bindir}/product-update
%{_bindir}/beaker-repo-update
%{_bindir}/beaker-sync-tasks
%{_bindir}/beaker-refresh-ldap
%{_bindir}/beaker-create-kickstart
%{_bindir}/beaker-create-ipxe-image
%{_mandir}/man8/beaker-create-ipxe-image.8.gz
%{_mandir}/man8/beaker-create-kickstart.8.gz
%{_mandir}/man8/beaker-init.8.gz
%{_mandir}/man8/beaker-repo-update.8.gz
%{_mandir}/man8/beaker-usage-reminder.8.gz
%{_unitdir}/beakerd.service
%attr(0644,apache,apache) %{_tmpfilesdir}/beaker-server.conf
%attr(-,apache,root) %dir /run/%{name}
%config(noreplace) %{_sysconfdir}/cron.d/%{name}
%config(noreplace) %{_sysconfdir}/rsyslog.d/beaker-server.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/beaker
%attr(0755,root,root)%{_bindir}/beakerd
%config(noreplace) %{_sysconfdir}/httpd/conf.d/beaker-server.conf
%attr(-,apache,root) %dir %{_datadir}/bkr
%attr(-,apache,root) %{_datadir}/bkr/beaker-server.wsgi
%attr(-,apache,root) %{_datadir}/bkr/server
%ghost %attr(0777,root,root) %{_datadir}/bkr/server/assets/site.less
%attr(0660,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/server.cfg
%dir %{_localstatedir}/log/%{name}
%dir %{_localstatedir}/cache/%{name}
%attr(-,apache,root) %dir %{_localstatedir}/cache/%{name}/assets
%attr(-,apache,root) %dir %{_localstatedir}/www/%{name}/logs
%attr(-,apache,root) %dir %{_localstatedir}/www/%{name}/rpms
%attr(-,apache,root) %dir %{_localstatedir}/www/%{name}/repos
%attr(-,apache,root) %dir %{_localstatedir}/lib/%{name}
%endif
%if %{without python3}
%files integration-tests
%{python2_sitelib}/bkr/inttest/
%{python2_sitelib}/beaker_integration_tests-*-nspkg.pth
%{python2_sitelib}/beaker_integration_tests-*.egg-info/
%{_datadir}/beaker-integration-tests
%endif
%files client
%dir %{_sysconfdir}/%{name}
%doc Client/client.conf.example
%if %{with python3}
%{python3_sitelib}/bkr/client/
%{python3_sitelib}/bkr/future/
%{python3_sitelib}/%{name}_client-*-nspkg.pth
%{python3_sitelib}/%{name}_client-*.egg-info/
%else
%{python2_sitelib}/bkr/future/
%{python2_sitelib}/beaker_client-*-nspkg.pth
%{python2_sitelib}/beaker_client-*.egg-info/
%endif
%{_bindir}/bkr
%{_mandir}/man1/bkr.1.gz
%{_mandir}/man1/bkr-*.1.gz
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%{_datadir}/bash-completion
%else
%{_sysconfdir}/bash_completion.d
%endif
%if %{without python3}
%files lab-controller
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/labcontroller.conf
%{_sysconfdir}/%{name}/power-scripts/
%{_sysconfdir}/%{name}/install-failure-patterns/
%{python2_sitelib}/bkr/labcontroller/
%{python2_sitelib}/beaker_lab_controller-*-nspkg.pth
%{python2_sitelib}/beaker_lab_controller-*.egg-info/
%{_bindir}/beaker-proxy
%{_bindir}/beaker-watchdog
%{_bindir}/beaker-transfer
%{_bindir}/beaker-import
%{_bindir}/beaker-provision
%{_bindir}/beaker-pxemenu
%{_bindir}/beaker-expire-distros
%{_bindir}/beaker-clear-netboot
%{_mandir}/man8/beaker-import.8.gz
%config(noreplace) %{_sysconfdir}/httpd/conf.d/beaker-lab-controller.conf
%attr(-,apache,root) %dir %{_datadir}/bkr
%attr(-,apache,root) %{_datadir}/bkr/lab-controller
%config(noreplace) %{_sysconfdir}/cron.hourly/beaker_expire_distros
%attr(-,apache,root) %dir %{_var}/www/%{name}
%attr(-,apache,root) %dir %{_var}/www/%{name}/logs
%dir %{_localstatedir}/log/%{name}
%{_unitdir}/beaker-proxy.service
%{_unitdir}/beaker-provision.service
%{_unitdir}/beaker-watchdog.service
%{_unitdir}/beaker-transfer.service
%{_tmpfilesdir}/beaker-lab-controller.conf
%attr(-,apache,root) %dir /run/%{name}-lab-controller
%attr(0440,root,root) %config(noreplace) %{_sysconfdir}/sudoers.d/beaker_proxy_clear_netboot
%config(noreplace) %{_sysconfdir}/rsyslog.d/beaker-lab-controller.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/beaker
%endif
%if %{without python3}
%files lab-controller-addDistro
%{_var}/lib/%{name}/addDistro.sh
%{_var}/lib/%{name}/addDistro.d/*
%endif
%changelog