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
|
%bcond_without check
%bcond_with doc
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_of_Additional_RPM_Macros
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
%global copr_common_version 0.19.1~~dev
# Please bump the %%flavor_guard version every-time some incompatible change
# happens (since the last release) in %%flavor_files set of files. Those files
# are basically replaced by third-party flavor providers, and any file removal,
# addition, movement or change will make the third-party flavor non-working. By
# changing the version we make the package explicitly incompatible and
# third-party flavor providers are notified they have to update their packages,
# too.
%global flavor_guard %name-flavor = 5
%global flavor_provides Provides: %flavor_guard
%global flavor_files_list %_datadir/copr/copr-flavor-filelist
%global flavor_generator %_datadir/copr/coprs_frontend/generate_colorscheme
%global staticdir %_datadir/copr/coprs_frontend/coprs/static
%global templatedir %_datadir/copr/coprs_frontend/coprs/templates
%global flavor_files \
%staticdir/header_background.png \
%staticdir/favicon.ico \
%staticdir/copr_logo.png \
%staticdir/css/copr-flavor.css \
%templatedir/additional_token_info.html \
%templatedir/project_info.html \
%templatedir/quick_enable.html \
%templatedir/user_meta.html \
%templatedir/homepage_header.html \
%templatedir/documentation_cards.html \
%templatedir/welcome.html \
%templatedir/contact_us.html
%global devel_files \
%flavor_generator
%define exclude_files() %{lua:
macro = "%" .. rpm.expand("%1") .. "_files"
x = rpm.expand(macro)
for line in string.gmatch(x, "([^\\n]+)") do
print("%exclude " .. line .. "\\n")
end
}
Name: copr-frontend
Version: 1.206
Release: 1
Summary: Frontend for Copr
License: GPL-2.0-or-later
URL: https://github.com/fedora-copr/copr
# Source is created by:
# git clone %%url && cd copr
# tito build --tgz --tag %%name-%%version-%%release
Source0: %name-%version.tar.gz
Patch1: add_openeuler_pkg.patch
Patch2: packages_statistics.patch
Patch3: proxyfix.patch
Patch4: pyporter.patch
#Patch5: quota.patch
Patch6: views_misc.patch
Patch7: frontend-FTBFS-below-py312.patch
BuildArch: noarch
BuildRequires: systemd
BuildRequires: util-linux
%if %{with doc}
BuildRequires: epydoc
BuildRequires: graphviz
%endif
BuildRequires: python3-devel
%if %{with check}
BuildRequires: python3dist(alembic)
BuildRequires: python3dist(anytree)
BuildRequires: python3dist(click)
BuildRequires: python3dist(commonmark)
BuildRequires: python3dist(blinker)
BuildRequires: python3dist(beautifulsoup4)
BuildRequires: python3dist(copr-common) >= %copr_common_version
BuildRequires: python3dist(email-validator)
BuildRequires: python3dist(python-dateutil)
BuildRequires: python3dist(decorator)
BuildRequires: python3dist(flask)
BuildRequires: python3dist(templated-dictionary)
BuildRequires: python3dist(flask-caching)
BuildRequires: python3dist(flask-openid)
BuildRequires: python3dist(flask-sqlalchemy)
BuildRequires: python3dist(flask-session)
BuildRequires: python3dist(flask-whooshee)
BuildRequires: python3dist(flask-wtf)
BuildRequires: python3dist(flask-restx)
BuildRequires: python3-gobject
BuildRequires: python3dist(html2text)
BuildRequires: python3dist(html5-parser)
BuildRequires: python3dist(humanize)
BuildRequires: python3dist(lxml)
BuildRequires: python3dist(markdown)
BuildRequires: python3dist(markupsafe)
BuildRequires: python3dist(munch)
BuildRequires: python3dist(netaddr)
BuildRequires: python3dist(python-openid-teams)
BuildRequires: python3dist(pygments)
BuildRequires: python3dist(pylibravatar)
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytz)
BuildRequires: python3dist(redis)
BuildRequires: python3dist(requests)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinxcontrib-httpdomain)
BuildRequires: python3dist(sqlalchemy-utils)
BuildRequires: python3dist(whoosh)
BuildRequires: python3dist(wtforms) >= 2.2.1
BuildRequires: python3dist(python-ldap)
BuildRequires: python3dist(pyyaml)
BuildRequires: python3dist(backoff) >= 1.9.0
BuildRequires: python3dist(pygal)
BuildRequires: redis
BuildRequires: modulemd-tools >= 0.6
BuildRequires: python3dist(authlib)
BuildRequires: openstack-release-wallaby
%endif
Requires: crontabs
Requires: curl
Requires: httpd
Recommends: logrotate
Recommends: mod_auth_gssapi
Requires: redis
Requires: %flavor_guard
Requires: (copr-selinux if selinux-policy-targeted)
Recommends: fedora-messaging
Requires: js-jquery
Requires: python3dist(anytree)
Requires: python3dist(click)
Requires: python3dist(commonmark)
Requires: python3dist(alembic)
Requires: python3dist(blinker)
Requires: python3dist(copr-common) >= %copr_common_version
Requires: python3dist(python-dateutil)
Requires: python3dist(email-validator)
Requires: python3dist(flask)
Requires: python3dist(flask-caching)
Requires: python3dist(flask-openid)
Requires: python3dist(flask-sqlalchemy)
Requires: python3dist(flask-session)
Requires: python3dist(flask-whooshee)
Requires: python3dist(flask-wtf)
Requires: python3dist(flask-restx)
Requires: python3-gobject
Requires: python3dist(html2text)
Requires: python3dist(html5-parser)
Requires: python3dist(humanize)
Requires: python3dist(lxml)
Requires: python3dist(markdown)
Requires: python3dist(markupsafe)
Requires: python3dist(mod-wsgi)
Requires: python3dist(munch)
Requires: python3dist(netaddr)
Requires: python3dist(python-openid-teams)
Requires: python3dist(psycopg2)
Requires: python3dist(pygments)
Requires: python3dist(pylibravatar)
Requires: python3dist(pytz)
Requires: python3dist(redis)
Requires: python3dist(requests)
Requires: python3dist(sqlalchemy-utils)
Requires: python3dist(templated-dictionary)
Requires: python3dist(wtforms) >= 2.2.1
Requires: python3dist(pyzmq)
Requires: python3dist(python-ldap)
Requires: python3dist(backoff) >= 1.9.0
Requires: python3dist(pygal)
Requires: python3dist(xstatic-bootstrap-scss)
Requires: python3dist(xstatic-datatables)
Requires: js-jquery-ui
Requires: python3dist(xstatic-patternfly)
Requires: modulemd-tools >= 0.6
Requires: python3dist(authlib)
Provides: bundled(bootstrap-combobox) = 1.1.6
Provides: bundled(bootstrap-select) = 1.5.4
Provides: bundled(bootstrap-treeview) = 1.0.1
Provides: bundled(c3) = 0.4.10
Provides: bundled(d3) = 3.5.0
Provides: bundled(datatables-colreorder) = 1.1.3
Provides: bundled(datatables-colvis) = 1.1.2
Provides: bundled(font-awesome) = 1.0.1
Provides: bundled(google-code-prettify) = 4.3.0
%description
COPR is lightweight build system. It allows you to create new project in WebUI,
and submit new builds and COPR will create yum repository from latests builds.
This package contains frontend.
%if %{with doc}
%package doc
Summary: Code documentation for COPR
Obsoletes: copr-doc < 1.38
%description doc
COPR is lightweight build system. It allows you to create new project in WebUI,
and submit new builds and COPR will create yum repository from latests builds.
This package include documentation for COPR code. Mostly useful for developers
only.
%endif
%package devel
Summary: Development files to build against %{name}
%description devel
Files which allow a build against %{name}, currently it's useful to build
custom %{name}-flavor package.
%prep
%autosetup -p1
%build
%if %{with doc}
COPR_CONFIG=../../documentation/copr-documentation.conf \
make -C documentation %{?_smp_mflags} python
%endif
%install
install -d %{buildroot}%{_sysconfdir}/copr
install -d %{buildroot}%{_datadir}/copr/coprs_frontend
install -d %{buildroot}%{_sharedstatedir}/copr/data/openid_store
install -d %{buildroot}%{_sharedstatedir}/copr/data/openid_store/associations
install -d %{buildroot}%{_sharedstatedir}/copr/data/openid_store/nonces
install -d %{buildroot}%{_sharedstatedir}/copr/data/openid_store/temp
install -d %{buildroot}%{_sharedstatedir}/copr/data/whooshee
install -d %{buildroot}%{_sharedstatedir}/copr/data/whooshee/copr_user_whoosheer
install -d %{buildroot}%{_sharedstatedir}/copr/data/srpm_storage
install -d %{buildroot}%{_sysconfdir}/cron.hourly
install -d %{buildroot}%{_sysconfdir}/cron.daily
install -d %{buildroot}/%{_bindir}
install -d %{buildroot}%{_unitdir}
install -d %{buildroot}%{_libexecdir}
install -p -m 755 conf/cron.hourly/copr-frontend* %{buildroot}%{_sysconfdir}/cron.hourly
install -p -m 755 conf/cron.daily/copr-frontend* %{buildroot}%{_sysconfdir}/cron.daily
install -p -m 755 coprs_frontend/run/copr_dump_db.sh %{buildroot}%{_libexecdir}
cp -a coprs_frontend/* %{buildroot}%{_datadir}/copr/coprs_frontend
rm -rf %{buildroot}%{_datadir}/copr/coprs_frontend/tests
sed -i "s/__RPM_BUILD_VERSION/%{version}-%{release}/" %{buildroot}%{_datadir}/copr/coprs_frontend/coprs/templates/layout.html
mv %{buildroot}%{_datadir}/copr/coprs_frontend/coprs.conf.example ./
mv %{buildroot}%{_datadir}/copr/coprs_frontend/config/* %{buildroot}%{_sysconfdir}/copr
rm %{buildroot}%{_datadir}/copr/coprs_frontend/CONTRIBUTION_GUIDELINES
touch %{buildroot}%{_sharedstatedir}/copr/data/copr.db
install -d %{buildroot}%{_var}/log/copr-frontend
install -d %{buildroot}%{_sysconfdir}/logrotate.d
cp -a conf/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
touch %{buildroot}%{_var}/log/copr-frontend/frontend.log
ln -fs /usr/share/copr/coprs_frontend/manage.py %{buildroot}/%{_bindir}/copr-frontend
mkdir -p %buildroot/$(dirname %flavor_files_list)
cat <<EOF > %buildroot%flavor_files_list
%flavor_files
EOF
mkdir -p %buildroot%macrosdir
cat <<EOF >%buildroot%macrosdir/macros.coprfrontend
%%copr_frontend_flavor_pkg \\
%flavor_provides \\
Requires: copr-frontend
%%copr_frontend_flavor_filelist %flavor_files_list
%%copr_frontend_flavor_generator %flavor_generator
%%copr_frontend_staticdir %staticdir
%%copr_frontend_templatedir %templatedir
%%copr_frontend_chroot_logodir %%copr_frontend_staticdir/chroot_logodir
EOF
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/copr/coprs_frontend/coprs
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/copr/coprs_frontend/alembic
%check
%if %{with check}
./run_tests.sh -vv --no-cov
%endif
%pre
getent group copr-fe >/dev/null || groupadd -r copr-fe
getent passwd copr-fe >/dev/null || \
useradd -r -g copr-fe -G copr-fe -d %{_datadir}/copr/coprs_frontend -s /bin/bash -c "COPR frontend user" copr-fe
usermod -L copr-fe
%post
/bin/systemctl condrestart httpd.service || :
%systemd_post fm-consumer@copr_messaging.service
%preun
%systemd_preun fm-consumer@copr_messaging.service
%postun
/bin/systemctl condrestart httpd.service || :
%systemd_postun_with_restart fm-consumer@copr_messaging.service
%files
%license LICENSE
%doc coprs.conf.example
%dir %{_datadir}/copr
%dir %{_sysconfdir}/copr
%dir %{_sharedstatedir}/copr
%{_datadir}/copr/coprs_frontend
%{_bindir}/copr-frontend
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%defattr(-, copr-fe, copr-fe, -)
%dir %{_sharedstatedir}/copr/data
%dir %{_sharedstatedir}/copr/data/openid_store
%dir %{_sharedstatedir}/copr/data/whooshee
%dir %{_sharedstatedir}/copr/data/whooshee/copr_user_whoosheer
%dir %{_sharedstatedir}/copr/data/srpm_storage
%ghost %{_sharedstatedir}/copr/data/copr.db
%defattr(644, copr-fe, copr-fe, 755)
%dir %{_var}/log/copr-frontend
%ghost %{_var}/log/copr-frontend/*.log
%defattr(600, copr-fe, copr-fe, 700)
%config(noreplace) %{_sysconfdir}/copr/copr.conf
%config(noreplace) %{_sysconfdir}/copr/copr_devel.conf
%config(noreplace) %{_sysconfdir}/copr/copr_unit_test.conf
%config(noreplace) %{_sysconfdir}/copr/chroots.conf
%defattr(-, root, root, -)
%config %{_sysconfdir}/cron.hourly/copr-frontend
%config %{_sysconfdir}/cron.daily/copr-frontend
%config(noreplace) %{_sysconfdir}/cron.hourly/copr-frontend-optional
%config(noreplace) %{_sysconfdir}/cron.daily/copr-frontend-optional
%{_libexecdir}/copr_dump_db.sh
%exclude_files flavor
%exclude_files devel
%files devel
%license LICENSE
%flavor_files_list
%devel_files
%macrosdir/*
%if %{with doc}
%files doc
%license LICENSE
%doc documentation/python-doc
%endif
%changelog
* Tue Mar 25 2025 li chaoran <pkwarcraft@hotmail.com> 1.206-1
- Init package 1.206
|