-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaf.spec.in
334 lines (298 loc) · 10.5 KB
/
faf.spec.in
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
Name: faf
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
Summary: Analysis framework for Fedora
Group: Development/Libraries
License: GPLv3+
URL: http://fedorahosted.org/faf
Source0: https://fedorahosted.org/released/faf/faf-%{version}.tar.xz
%if 0%{?rhel:%{rhel} < 7}
%define sqlalchemy python-sqlalchemy0.7
%define python_argparse python-argparse
%else
%define sqlalchemy python-sqlalchemy
%define python_argparse python
%endif
Requires(pre): shadow-utils
Requires: binutils
Requires: btparser-python >= 0.25
# eu-addr2line 0.155 gives much better results
Requires: elfutils >= 0.155
Requires: koji
Requires: libreport-plugin-kerneloops
Requires: libxml2-python
Requires: pycurl
Requires: %{python_argparse}
Requires: python-fedora
Requires: python-magic
Requires: python-psycopg2
Requires: python-setuptools
Requires: python-solv >= 0.0.0-17
Requires: python-bugzilla >= 0.8.0
Requires: rpm-build
Requires: rpm-python
Requires: %{sqlalchemy}
Requires: yum
BuildRequires: asciidoc
BuildRequires: autoconf
BuildRequires: elfutils-devel
BuildRequires: intltool
BuildRequires: libtool
BuildRequires: xmlto
# requirements for tests
BuildRequires: btparser-python >= 0.25
BuildRequires: kobo-client
BuildRequires: kobo-django
BuildRequires: kobo-hub
BuildRequires: libxml2-python
BuildRequires: %{python_argparse}
BuildRequires: python-bugzilla >= 0.8.0
BuildRequires: python-django-dajax
BuildRequires: python-django-dajaxice
BuildRequires: python-django-openid-auth
BuildRequires: python-setuptools
BuildRequires: python-solv
BuildRequires: python-unittest2
BuildRequires: rpm-python
BuildRequires: %{sqlalchemy}
BuildRequires: yum
%description
Faf is a programmable platform for analysis of packages, packaging
issues, bug reports and other artifacts produced within Fedora
operating system development.
%package hub
Summary: Kobo hub for %{name} tasks
Group: System Environment/Libraries
Requires: %{name} = %{version}
# this is just how we named the unofficial package
# it should get to fedora as python-django-bootstrap or so
Requires: bootstrap
Requires: httpd
Requires: kobo-client
Requires: kobo-django
Requires: kobo-hub
Requires: mod_wsgi
Requires: python-django-dajax
Requires: python-django-dajaxice
Requires: python-django-openid-auth
Requires: python-django-select2
Requires: python-tw2-jquery
Requires: python-tw2-jqplugins-flot
BuildArch: noarch
Requires(post): file
%if 0%{?fedora} >= 15
Requires(post): systemd-units httpd
Requires(postun): systemd-units httpd
%endif
%description hub
Kobo hub for %{name} tasks
%package emergency
Summary: Emergency WSGI application
Group: System Environment/Libraries
Requires: %{name} = %{version}
Requires: httpd
Requires: mod_wsgi
BuildArch: noarch
%description emergency
Provides emergency WSGI application
capable of saving reports to disk
to work as a backup in case of server
issues.
%package worker
Summary: Kobo worker for %{name} tasks
Group: System Environment/Libraries
Requires: %{name} = %{version}
Requires: kobo-client
Requires: kobo-worker
BuildArch: noarch
%description worker
Kobo worker for %{name} tasks
%package client
Summary: Kobo client for %{name} tasks
Group: System Environment/Libraries
Requires: %{name} = %{version}
Requires: kobo-client
BuildArch: noarch
%description client
Kobo client for %{name} tasks
%prep
%setup -q
./autogen.sh
%build
%configure
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
install -d -m 2775 %{buildroot}%{_localstatedir}/lib/faf
mkdir -p %{buildroot}%{python_sitelib}/pyfaf/hub/tasks
mkdir -p %{buildroot}%{_localstatedir}/cache/faf/dumpdirs
mkdir -p %{buildroot}%{_localstatedir}/spool/faf
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/hub
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/hub/tasks
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/hub/upload
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/repo
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/report
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/report/incoming
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/report/saved
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/report/deferred
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/report/attachments
mkdir -p %{buildroot}%{_localstatedir}/spool/faf/worker
mkdir -p %{buildroot}%{_localstatedir}/log/faf/build
mkdir -p %{buildroot}%{_datadir}/faf/hub/static
# On Fedora, the Python WSGI module is loaded by wsgi.conf in the
# conf.d HTTPD configuration directory. faf-hub.conf requires WSGI to
# be already active. Here we rename the faf-hub.conf and
# faf-emergency.conf to be loaded after wsgi.conf and not before.
mv %{buildroot}%{_sysconfdir}/httpd/conf.d/{,wsgi-}faf-hub.conf
mv %{buildroot}%{_sysconfdir}/httpd/conf.d/{,wsgi-}faf-emergency.conf
%check
make check
%pre
# http://fedoraproject.org/wiki/Packaging:UsersAndGroups
getent group faf >/dev/null || groupadd --system faf
getent passwd faf >/dev/null || useradd --system -g faf -d /etc/faf -s /sbin/nologin -c "Helper user for faf (analysis framework for Fedora) tools" faf
exit 0
%post
%define crontab_entry_1 "#0 0,12 * * * faf-bugzilla-pull-bugs >> /var/log/faf/bugzilla-cron.log 2>&1"
%define crontab_entry_2 "#0 3 * * 6 (faf-koji-pull-tags fedora -v && faf-koji-pull-builds --only-missing --with-rpms fedora dist-rawhide -v ) >> /var/log/faf/koji-cron.log 2>&1"
%define crontab_entry_3 "#*/5 * * * * faf-client save-reports >> /var/log/faf/save-report-cron.log 2>&1"
%define crontab_entry_4 "#0 0 * * * faf-client create-problems >> /var/log/faf/create-problems-cron.log 2>&1"
if [ "$1" = 1 ]
then
# add disabled crontab entries
( crontab -u faf -l 2> /dev/null; echo %{crontab_entry_1}; echo %{crontab_entry_2}; echo %{crontab_entry_3}; echo %{crontab_entry_4} ) | crontab -u faf - 2> /dev/null
fi
# if file magic is not able to recognize LLVM bitcode files, add it to /etc/magic
echo -e "BC\xc0\xde" | file - | grep "LLVM\ bitcode" &> /dev/null || echo "0 string BC\xc0\xde LLVM bitcode" >> /etc/magic
%post hub
if [ "$1" = 1 ]
then
# "\041" = "!" - exclude it to be safely used as sed separator
# "\042" = '"' - exclude
RANDOM_STR=`tr -c -d '[\043-\176]' < /dev/urandom | head -c 50`
sed -i -e "s!@RANDOM_STRING@!$RANDOM_STR!g" %{python_sitelib}/pyfaf/hub/settings.py
LOGFILE=%{_localstatedir}/log/%{name}/syncdb_output.log
date >> $LOGFILE
faf-hub syncdb --noinput >> $LOGFILE 2>&1
%if 0%{?fedora} >= 15
# Package install
# Reload httpd to show the new version of hub
/bin/systemctl try-restart httpd.service >/dev/null 2>&1 || :
%endif
fi
%postun hub
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
# Reload httpd to show the new version of hub
/bin/systemctl try-restart httpd.service >/dev/null 2>&1 || :
fi
%preun
if [ "$1" = 0 ]
then
# comment out all crontab entries
( crontab -u faf -l 2> /dev/null | sed "s,^\([^#].*\)$,#\1,g" ) | crontab -u faf - 2> /dev/null
fi
%files
%dir %{_sysconfdir}/faf
%dir %{_sysconfdir}/faf/plugins
%dir %{_sysconfdir}/faf/templates
%config(noreplace) %{_sysconfdir}/faf/config
%config(noreplace) %{_sysconfdir}/faf/plugins/bugzilla.conf
%config(noreplace) %{_sysconfdir}/faf/templates/bugzilla_new_body
%config(noreplace) %{_sysconfdir}/faf/templates/bugzilla_new_summary
%config(noreplace) %{_sysconfdir}/faf/templates/bugzilla_update_comment
%config(noreplace) %{_sysconfdir}/httpd/conf.d/faf.conf
%config(noreplace) %{_sysconfdir}/libreport/events.d/faf_event.conf
%dir %attr(0775, faf, faf) %{_localstatedir}/spool/faf
%dir %attr(0775, faf, faf) %{_localstatedir}/spool/faf/repo
%dir %attr(0775, faf, faf) %{_localstatedir}/spool/faf/report
%dir %attr(0775, faf, faf) %{_localstatedir}/spool/faf/report/incoming
%dir %attr(0775, faf, faf) %{_localstatedir}/spool/faf/report/saved
%dir %attr(0775, faf, faf) %{_localstatedir}/spool/faf/report/deferred
%dir %attr(0775, faf, faf) %{_localstatedir}/spool/faf/report/attachments
%dir %attr(0775, faf, faf) %{_localstatedir}/log/faf
%dir %attr(0775, faf, faf) %{_localstatedir}/log/faf/build
%dir %attr(2775, root, faf) %{_localstatedir}/lib/faf
%dir %{_datadir}/faf
%dir %{_datadir}/faf/wrappers
%{_bindir}/faf-bugzilla-create-bugs
%{_bindir}/faf-bugzilla-pull-bugs
%{_bindir}/faf-bugzilla-update-bugs
%{_bindir}/faf-c2p
%{_bindir}/faf-chroot
%attr(04750,root,faf) %{_bindir}/faf-chroot-helper
%{_bindir}/faf-config
%{_bindir}/faf-convert-lob-structure
%{_bindir}/faf-create-problems
%{_bindir}/faf-demangle-existing
%{_bindir}/faf-dwarf-files
%{_bindir}/faf-export-reports
%{_bindir}/faf-fedora-pkgdb
%{_bindir}/faf-fedora-pkgdb-pull-collections
%{_bindir}/faf-fedora-pkgdb-pull-packages
%{_bindir}/faf-fedora-pkgdb-pull-people
%{_bindir}/faf-fix-inlined
%{_bindir}/faf-fixtures
%{_bindir}/faf-koji
%{_bindir}/faf-koji-pull-builds
%{_bindir}/faf-koji-pull-tags
%{_bindir}/faf-llvm-build
%{_bindir}/faf-llvm-build-all
%{_bindir}/faf-mail
%{_bindir}/faf-obs-pull-builds
%{_bindir}/faf-retrace
%{_bindir}/faf-refreshrepo
%{_bindir}/faf-report-kerneloops
%{_bindir}/faf-save-reports
%{_bindir}/faf-shell
%{_bindir}/faf-stats-components
%{_bindir}/faf-stats-functions
%{_bindir}/faf-stats-problems
%{_bindir}/faf-stats-trends
%{_bindir}/faf-sync
%{_bindir}/faf-update-crashfn
%{_mandir}/man1/faf-*.1.gz
%{_datadir}/faf/*.html
%{_datadir}/faf/wrappers/*
%{_datadir}/faf/fixtures/*
%dir %{python_sitelib}/pyfaf
%{python_sitelib}/pyfaf/argparse.py*
%{python_sitelib}/pyfaf/bugzilla.py*
%{python_sitelib}/pyfaf/config.py*
%{python_sitelib}/pyfaf/cluster.py*
%{python_sitelib}/pyfaf/__init__.py*
%{python_sitelib}/pyfaf/queries.py*
%{python_sitelib}/pyfaf/kb.py*
%{python_sitelib}/pyfaf/libsolv.py*
%{python_sitelib}/pyfaf/obs.py*
%{python_sitelib}/pyfaf/package.py*
%{python_sitelib}/pyfaf/retrace.py*
%{python_sitelib}/pyfaf/support.py*
%{python_sitelib}/pyfaf/terminal.py*
%{python_sitelib}/pyfaf/ureport.py*
%{python_sitelib}/pyfaf/common.py*
%{python_sitelib}/pyfaf/template.py*
%{python_sitelib}/pyfaf/storage
%files hub
%config(noreplace) %{_sysconfdir}/httpd/conf.d/wsgi-faf-hub.conf
%{python_sitelib}/pyfaf/hub
%{_bindir}/faf-hub
%dir %attr(0770, faf, faf) %{_localstatedir}/spool/faf/hub
%dir %attr(0770, faf, faf) %{_localstatedir}/spool/faf/hub/tasks
%dir %attr(0770, faf, faf) %{_localstatedir}/spool/faf/hub/upload
%{_datadir}/faf/hub
%files emergency
%config(noreplace) %{_sysconfdir}/httpd/conf.d/wsgi-faf-emergency.conf
%{python_sitelib}/pyfaf/emergency
%files worker
%config(noreplace) %{_sysconfdir}/faf/worker.conf
%{python_sitelib}/pyfaf/worker
%{_bindir}/faf-worker
%dir %attr(0770, faf, faf) %{_localstatedir}/spool/faf/worker
%files client
%config(noreplace) %{_sysconfdir}/faf/client.conf
%{python_sitelib}/pyfaf/client
%{_bindir}/faf-client
%changelog
* Mon Aug 30 2010 Karel Klic <[email protected]> @PACKAGE_VERSION@-1
- Upstream package spec file