/[packages]/cauldron/koschei/current/SPECS/koschei.spec
ViewVC logotype

Contents of /cauldron/koschei/current/SPECS/koschei.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1964280 - (show annotations) (download)
Sat Jul 29 10:36:27 2023 UTC (10 months, 2 weeks ago) by wally
File size: 11296 byte(s)
- do not own /etc/bash_completion.d/
1 # The tests fail due to task queue overflows in iurt,
2 # rather than any particular code failure, so they're disabled for now
3 %bcond_with tests
4
5 # We do not have Fedora infrastructure,
6 # so this aspect of Koschei is disabled
7 %bcond_with fedora_infra
8
9 Name: koschei
10 Version: 2.4.0
11 Release: %mkrel 6
12 Summary: Continuous integration for packages built with Koji and Copr
13 Group: System/Servers
14 License: GPLv2+
15 URL: https://github.com/msimacek/%{name}
16 Source0: https://github.com/msimacek/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
17
18 # Upstream patches
19 Patch0001: 0001-Port-to-new-hawkey.patch
20
21 # Mageia specific patches
22 # We don't have js-jquery packaged, so revert to using online copy
23 Patch1000: koschei-2.4.0-mga-Revert-Use-local-JQuery.patch
24
25 BuildArch: noarch
26
27 # For systemd macro definitions
28 BuildRequires: systemd-devel
29
30 BuildRequires: python3-devel
31 BuildRequires: python3-setuptools
32
33 %if %{with tests}
34 BuildRequires: postgresql-server
35 BuildRequires: python3-mock
36 BuildRequires: python3-nose
37 BuildRequires: python3-vcrpy
38 %endif
39
40 BuildRequires: python3-sqlalchemy
41 BuildRequires: python3-koji
42 BuildRequires: python3-hawkey
43 BuildRequires: python3-librepo
44 BuildRequires: python3-rpm
45 #BuildRequires: python3-fedmsg-core
46 BuildRequires: python3-psycopg2
47 BuildRequires: python3-flask
48 BuildRequires: python3-flask-sqlalchemy
49 BuildRequires: python3-flask-wtf
50 BuildRequires: python3-wtforms
51 BuildRequires: python3-humanize >= 0.5.1
52 BuildRequires: python3-jinja2
53 BuildRequires: python3-dogpile-cache
54 BuildRequires: python3-copr
55 BuildRequires: python3-requests
56
57
58 %description
59 Service tracking dependency changes and rebuilding packages whose
60 dependencies change too much. It uses Koji scratch builds to do the rebuilds and
61 provides a web interface to the results.
62
63
64 %package common
65 Summary: Actual python code for koschei backend and frontend
66 Group: System/Servers
67 Requires: python3-sqlalchemy
68 Requires: python3-psycopg2
69 Requires: python3-rpm
70 Requires(pre): shadow-utils
71
72 %description common
73 %{summary}.
74
75
76 %package admin
77 Summary: Administration script and DB migrations for koschei
78 Group: System/Servers
79 Requires: %{name}-common = %{version}-%{release}
80 Requires: python3-alembic
81 Requires: postgresql
82
83
84 %description admin
85 %{summary}.
86
87 %package frontend
88 Summary: Web frontend for koschei using mod_wsgi
89 Group: System/Servers
90 Requires: %{name}-common = %{version}-%{release}
91 Requires: python3-flask
92 Requires: python3-flask-sqlalchemy
93 Requires: python3-flask-wtf
94 Requires: python3-wtforms
95 Requires: python3-humanize >= 0.5.1
96 Requires: python3-jinja2
97 Requires: apache-python3-mod_wsgi
98 Requires: apache
99
100 %description frontend
101 %{summary}.
102
103 %package backend
104 Summary: Koschei backend services
105 Group: System/Servers
106 Requires: %{name}-common = %{version}-%{release}
107 Requires: python3-koji
108 Requires: python3-hawkey
109 Requires: python3-librepo
110 Requires: python3-dogpile-cache
111 Requires(post): systemd
112 Requires(preun): systemd
113 Requires(postun): systemd
114
115 %description backend
116 %{summary}.
117
118 %if %{with fedora_infra}
119 %package common-fedora
120 Summary: Fedora-specific Koschei plugins (common parts of backend and frontend)
121 Group: System/Servers
122 Requires: %{name}-common = %{version}-%{release}
123 Requires: python3-dogpile-cache
124
125 %description common-fedora
126 %{summary}.
127
128 %package frontend-fedora
129 Summary: Fedora-specific Koschei frontend plugins
130 Group: System/Servers
131 Requires: %{name}-frontend = %{version}-%{release}
132 Requires: %{name}-common-fedora = %{version}-%{release}
133 Requires: python3-requests
134
135 %description frontend-fedora
136 %{summary}.
137
138 %package backend-fedora
139 Summary: Fedora-specific Koschei backend plugins
140 Group: System/Servers
141 Requires: %{name}-backend = %{version}-%{release}
142 Requires: %{name}-common-fedora = %{version}-%{release}
143 Requires: python3-fedmsg-core
144 Requires: python3-fedmsg-meta-fedora-infrastructure
145
146 Requires(post): systemd
147 Requires(preun): systemd
148 Requires(postun): systemd
149
150 %description backend-fedora
151 %{summary}.
152 %endif
153
154 %package common-copr
155 Summary: Koschei plugin for user rebuilds in Copr (common part)
156 Group: System/Servers
157 Requires: %{name}-common = %{version}-%{release}
158
159 %description common-copr
160 %{summary}.
161
162 %package backend-copr
163 Summary: Koschei plugin for user rebuilds in Copr (backend part)
164 Group: System/Servers
165 Requires: %{name}-backend = %{version}-%{release}
166 Requires: %{name}-common-copr = %{version}-%{release}
167 Requires: python3-copr
168
169 %description backend-copr
170 %{summary}.
171
172 %package frontend-copr
173 Summary: Koschei plugin for user rebuilds in Copr (frontend part)
174 Group: System/Servers
175 Requires: %{name}-frontend = %{version}-%{release}
176 Requires: %{name}-common-copr = %{version}-%{release}
177
178 %description frontend-copr
179 %{summary}.
180
181
182 %prep
183 %autosetup -p1
184
185 sed 's|@CACHEDIR@|%{_localstatedir}/cache/%{name}|g
186 s|@DATADIR@|%{_datadir}/%{name}|g
187 s|@VERSION@|%{version}-%{release}|g
188 s|@CONFDIR@|%{_sysconfdir}/%{name}|g
189 s|@STATEDIR@|%{_sharedstatedir}/%{name}|g' config.cfg.template > config.cfg
190
191 %build
192 %py3_build
193
194 PYTHONPATH=".:${PYTHONPATH}" %{__python3} aux/gen-bash-completion.py >koschei-admin.bash
195
196 %install
197 %py3_install
198
199 mkdir -p %{buildroot}%{_bindir}
200 mkdir -p %{buildroot}%{_datadir}/%{name}
201 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
202 mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
203
204 cp -p config-backend.cfg %{buildroot}%{_sysconfdir}/%{name}/config-backend.cfg
205 cp -p config-frontend.cfg %{buildroot}%{_sysconfdir}/%{name}/config-frontend.cfg
206 cp -p config-admin.cfg %{buildroot}%{_sysconfdir}/%{name}/config-admin.cfg
207 cp -p config.cfg %{buildroot}%{_datadir}/koschei/
208 cp -p *.sql %{buildroot}%{_datadir}/koschei/
209
210 install -dm 755 %{buildroot}%{_unitdir}
211 for unit in systemd/*; do
212 install -pm 644 $unit %{buildroot}%{_unitdir}/
213 done
214
215 install -pm 755 admin.py %{buildroot}%{_bindir}/%{name}-admin
216
217 install -dm 755 %{buildroot}%{_localstatedir}/cache/%{name}/repodata
218 install -dm 755 %{buildroot}%{_sharedstatedir}/%{name}
219
220 cp -pr templates %{buildroot}%{_datadir}/%{name}/
221
222 cp -pr alembic/ alembic.ini %{buildroot}%{_datadir}/%{name}/
223 cp -pr static %{buildroot}%{_datadir}/%{name}/
224 cp -p %{name}.wsgi %{buildroot}%{_datadir}/%{name}/
225 cp -p httpd.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
226
227 install -dm 755 %{buildroot}%{_libexecdir}/%{name}
228 ln -s %{__python3} %{buildroot}%{_libexecdir}/%{name}/koschei-scheduler
229 ln -s %{__python3} %{buildroot}%{_libexecdir}/%{name}/koschei-watcher
230 ln -s %{__python3} %{buildroot}%{_libexecdir}/%{name}/koschei-polling
231 ln -s %{__python3} %{buildroot}%{_libexecdir}/%{name}/koschei-build-resolver
232 ln -s %{__python3} %{buildroot}%{_libexecdir}/%{name}/koschei-repo-resolver
233 ln -s %{__python3} %{buildroot}%{_libexecdir}/%{name}/koschei-copr-resolver
234 ln -s %{__python3} %{buildroot}%{_libexecdir}/%{name}/koschei-copr-scheduler
235
236 install -dm 755 %{buildroot}%{_sysconfdir}/bash_completion.d/
237 install -p -m 644 koschei-admin.bash %{buildroot}%{_sysconfdir}/bash_completion.d/
238
239 %if ! %{with fedora_infra}
240 rm -rfv %{buildroot}%{python3_sitelib}/*/plugins/fedmsg_plugin
241 rm -rfv %{buildroot}%{python3_sitelib}/*/plugins/pagure_plugin
242
243 rm -fv %{buildroot}%{_libexecdir}/%{name}/*watcher*
244 rm -fv %{buildroot}%{_unitdir}/*watcher*
245 %endif
246
247
248 %if %{with tests}
249 %check
250 . aux/set-env.sh
251 pg_init
252 pg_start
253 trap pg_stop 0
254 %{__python3} setup.py test
255 %endif
256
257 %pre common
258 getent group %{name} >/dev/null || groupadd -r %{name}
259 # services and koschei-admin script is supposed to be run as this user
260 getent passwd %{name} >/dev/null || \
261 useradd -r -g %{name} -d %{_localstatedir}/cache/%{name} -s /bin/sh \
262 -c "Runs %{name} services" %{name}
263 exit 0
264
265 %post backend
266 %systemd_post %{name}-scheduler.service
267 %systemd_post %{name}-polling.service
268 %systemd_post %{name}-build-resolver.service
269 %systemd_post %{name}-repo-resolver.service
270
271 %preun backend
272 %systemd_preun %{name}-scheduler.service
273 %systemd_preun %{name}-polling.service
274 %systemd_preun %{name}-build-resolver.service
275 %systemd_preun %{name}-repo-resolver.service
276
277 %if %{with fedora_infra}
278 %post backend-fedora
279 %systemd_post %{name}-watcher.service
280
281 %preun backend-fedora
282 %systemd_preun %{name}-watcher.service
283 %endif
284
285 %post backend-copr
286 %systemd_post %{name}-copr-resolver.service
287 %systemd_post %{name}-copr-scheduler.service
288
289 %preun backend-copr
290 %systemd_preun %{name}-copr-resolver.service
291 %systemd_preun %{name}-copr-scheduler.service
292
293 %files common
294 %license LICENSE.txt
295 %{python3_sitelib}/*
296 %exclude %{python3_sitelib}/koschei/admin.py
297 %exclude %{python3_sitelib}/koschei/frontend
298 %exclude %{python3_sitelib}/koschei/backend
299 %exclude %{python3_sitelib}/koschei/plugins/*/
300 %dir %{python3_sitelib}/koschei/plugins
301 %{python3_sitelib}/koschei/plugins/__init__.*
302 %dir %{_datadir}/%{name}
303 %{_datadir}/%{name}/config.cfg
304 %attr(755, %{name}, %{name}) %{_localstatedir}/cache/%{name}
305 %dir %{_sysconfdir}/%{name}
306 %attr(755, %{name}, %{name}) %dir %{_sharedstatedir}/%{name}
307
308 %files admin
309 %{_bindir}/%{name}-admin
310 %dir %{_libexecdir}/%{name}
311 %{python3_sitelib}/koschei/admin.py
312 %{_datadir}/%{name}/alembic/
313 %{_datadir}/%{name}/*.sql
314 %{_datadir}/%{name}/alembic.ini
315 %{_sysconfdir}/bash_completion.d/koschei-admin.bash
316 %config(noreplace) %{_sysconfdir}/%{name}/config-admin.cfg
317
318 %files frontend
319 %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
320 %config(noreplace) %{_sysconfdir}/%{name}/config-frontend.cfg
321 %{_datadir}/%{name}/static
322 %{_datadir}/%{name}/templates
323 %{_datadir}/%{name}/%{name}.wsgi
324 %{python3_sitelib}/*/frontend
325
326 %files backend
327 %config(noreplace) %{_sysconfdir}/%{name}/config-backend.cfg
328 %dir %{_libexecdir}/%{name}
329 %{_libexecdir}/%{name}/koschei-scheduler
330 %{_libexecdir}/%{name}/koschei-polling
331 %{_libexecdir}/%{name}/koschei-build-resolver
332 %{_libexecdir}/%{name}/koschei-repo-resolver
333 %{_unitdir}/koschei-scheduler.service
334 %{_unitdir}/koschei-polling.service
335 %{_unitdir}/koschei-build-resolver.service
336 %{_unitdir}/koschei-repo-resolver.service
337 %{python3_sitelib}/*/backend
338 %{python3_sitelib}/*/plugins/repo_regen_plugin
339
340 %if %{with fedora_infra}
341 %files common-fedora
342 %{python3_sitelib}/*/plugins/fedmsg_plugin
343 %{python3_sitelib}/*/plugins/pagure_plugin
344 %exclude %{python3_sitelib}/*/plugins/*/backend*
345 %exclude %{python3_sitelib}/*/plugins/*/frontend*
346
347 %files frontend-fedora
348 %{python3_sitelib}/*/plugins/pagure_plugin/frontend*
349
350 %files backend-fedora
351 %{_libexecdir}/%{name}/koschei-watcher
352 %{_unitdir}/koschei-watcher.service
353 %{python3_sitelib}/*/plugins/fedmsg_plugin/backend*
354 %endif
355
356 %files common-copr
357 %{python3_sitelib}/*/plugins/copr_plugin
358 %exclude %{python3_sitelib}/*/plugins/*/backend*
359 %exclude %{python3_sitelib}/*/plugins/*/frontend*
360
361 %files frontend-copr
362 %{python3_sitelib}/*/plugins/copr_plugin/frontend*
363
364 %files backend-copr
365 %{_libexecdir}/%{name}/koschei-copr-resolver
366 %{_libexecdir}/%{name}/koschei-copr-scheduler
367 %{_unitdir}/koschei-copr-resolver.service
368 %{_unitdir}/koschei-copr-scheduler.service
369 %{python3_sitelib}/*/plugins/copr_plugin/backend*
370

  ViewVC Help
Powered by ViewVC 1.1.30