-
Notifications
You must be signed in to change notification settings - Fork 108
/
pbench-server.spec.j2
179 lines (149 loc) · 5.78 KB
/
pbench-server.spec.j2
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
Name: pbench-server
Version: {{ version }}
Release: {{ seqno }}{{ gdist }}
Summary: The pbench server bits
License: GPLv3+
URL: http://github.com/distributed-systems-analysis/pbench
Source0: pbench-server-%{version}.tar.gz
Buildarch: noarch
# NOTE: we add the "six" and "urllib3" Python 3.8 RPM requirements so that
# we don't end up pip installing those modules in the /opt/pbench-server/lib
# tree.
Requires: python38 python38-six python38-urllib3
# policycoreutils for semanage and restorecon - used in pbench-server-activate-create-results-dir
Requires: policycoreutils
Requires: policycoreutils-python-utils
Requires: npm
# installdir has to agree with the definition of install-dir in
# pbench-server.cfg, but we can't go out and pluck it from there,
# because we don't know where the config file is. Note that we omit
# the initial / - it is added in every use below. IMO, that's more
# readable since it appears in the middle of the path in all cases,
# *except* in the %files section (and one instance in the %post
# and %postun sections).
%define installdir opt/pbench-server
%define static html/static
%define __python python3
%description
The pbench server scripts.
%prep
%setup
%build
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{installdir}
cp -a ./server/* %{buildroot}/%{installdir}
mkdir -p %{buildroot}/%{installdir}/%{static}
cp -a ./web-server/* %{buildroot}/%{installdir}/%{static}
# for the npm install below
mv %{buildroot}/%{installdir}/%{static}/package.json %{buildroot}/%{installdir}
%post
# Install python dependencies
pip3 --no-cache-dir install --prefix=/%{installdir} -r /%{installdir}/requirements.txt > /%{installdir}/pip3-install.log
# install node.js modules under /%{installdir}
cd /%{installdir}
rm -rf node_modules
npm install
# this only handles v0.3
# AFAIK, we don't need all the other modules that package.json includes.
jslist="node_modules/d3/d3.min.js
node_modules/d3-queue/build/d3-queue.min.js
node_modules/save-svg-as-png/lib/saveSvgAsPng.js"
# Copy them to the appropriate directory for v0.3. That
# directory should exist already because of the `cp -a'
# of the web-server stuff above, but add an explicit
# mkdir just in case, although it should be a no-op.
mkdir -p /%{installdir}/%{static}/js/v0.3
for x in ${jslist} ;do
cp $x /%{installdir}/%{static}/js/v0.3
done
# Finally, make sure the installation directory is entirely owned
# by the pbench user.
chown -R pbench.pbench /%{installdir}
%preun
%postun
# if uninstalling, rather than updating, remove everything
if [ $1 -eq 0 ] ;then
crontab=/%{installdir}/lib/crontab/crontab
if [ -f $crontab ] ;then
crontab -u pbench -r
fi
rm -rf /%{installdir}
fi
%posttrans
%files
%defattr(644, pbench, pbench, 755)
/%{installdir}/VERSION
/%{installdir}/SEQNO
/%{installdir}/SHA1
/%{installdir}/requirements.txt
/%{installdir}/%{static}/VERSION
/%{installdir}/package.json
/%{installdir}/lib/config/pbench-server-satellite.cfg.example
/%{installdir}/lib/config/pbench-server.cfg.example
/%{installdir}/lib/config/pbench-server-default.cfg
/%{installdir}/lib/crontab
/%{installdir}/lib/mappings
/%{installdir}/lib/settings
/%{installdir}/lib/configtools/__init__.py
/%{installdir}/lib/pbench/__init__.py
/%{installdir}/lib/pbench/indexer.py
/%{installdir}/lib/pbench/mock.py
/%{installdir}/lib/pbench/report.py
/%{installdir}/lib/s3backup/__init__.py
/%{installdir}/bin/pbench-base.sh
%defattr(755, pbench, pbench, 755)
/%{installdir}/bin/getconf.py
/%{installdir}/bin/pbench-server-activate-create-crontab
/%{installdir}/bin/pbench-server-prep-shim-002
/%{installdir}/bin/pbench-audit-server
/%{installdir}/bin/pbench-backup-tarballs
/%{installdir}/bin/pbench-verify-backup-tarballs
/%{installdir}/bin/pbench-clean-up-dangling-results-links
/%{installdir}/bin/pbench-copy-sosreports
/%{installdir}/bin/pbench-index
/%{installdir}/bin/pbench-reindex
/%{installdir}/bin/pbench-unpack-tarballs
/%{installdir}/bin/pbench-satellite-cleanup
/%{installdir}/bin/pbench-satellite-state-change
/%{installdir}/bin/pbench-remote-satellite-state-change
/%{installdir}/bin/pbench-remote-sync-package-tarballs
/%{installdir}/bin/pbench-dispatch
/%{installdir}/bin/pbench-report-status
/%{installdir}/bin/pbench-pp-status
/%{installdir}/bin/pbench-sync-package-tarballs
/%{installdir}/bin/pbench-sync-satellite
/%{installdir}/bin/pbench-server-set-result-state
/%{installdir}/bin/pbench-audit-server.sh
/%{installdir}/bin/pbench-backup-tarballs.py
/%{installdir}/bin/pbench-base.py
/%{installdir}/bin/pbench-clean-up-dangling-results-links.sh
/%{installdir}/bin/pbench-copy-sosreports.sh
/%{installdir}/bin/pbench-dispatch.sh
/%{installdir}/bin/pbench-index.py
/%{installdir}/bin/pbench-reindex.py
/%{installdir}/bin/pbench-report-status.py
/%{installdir}/bin/pbench-satellite-cleanup.sh
/%{installdir}/bin/pbench-satellite-state-change.py
/%{installdir}/bin/pbench-server-prep-shim-002.sh
/%{installdir}/bin/pbench-sync-package-tarballs.sh
/%{installdir}/bin/pbench-sync-satellite.sh
/%{installdir}/bin/pbench-trampoline
/%{installdir}/bin/pbench-unpack-tarballs.sh
/%{installdir}/bin/pbench-verify-backup-tarballs.py
/%{installdir}/bin/pbench-check-tb-age
/%{installdir}/bin/pbench-check-tb-age.py
/%{installdir}/bin/pbench-cull-unpacked-tarballs
/%{installdir}/bin/pbench-cull-unpacked-tarballs.py
%defattr(644, pbench, pbench, 755)
/%{installdir}/%{static}/css/v0.2/pbench_utils.css
/%{installdir}/%{static}/js/v0.2/pbench_utils.js
/%{installdir}/%{static}/js/v0.2/app.js
/%{installdir}/%{static}/css/v0.3/jschart.css
/%{installdir}/%{static}/js/v0.3/jschart.js
%doc
/%{installdir}/lib/s3backup/README
/%{installdir}/lib/pbench/AUTHORS.log_formatter
/%{installdir}/lib/pbench/LICENSE.log_formatter
/%{installdir}/%{static}/css/v0.3/LICENSE.TXT
/%{installdir}/%{static}/js/v0.3/LICENSE.TXT