-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.spec
More file actions
350 lines (253 loc) · 8.42 KB
/
Copy pathproject.spec
File metadata and controls
350 lines (253 loc) · 8.42 KB
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
Summary: GSA
Name: greenbone-security-assistant
Version: 20.8.0
Release: RELEASE-AUTO%{?dist}.art
Source0: https://github.com/greenbone/gsa/archive/v%{version}.tar.gz
Source1: gsad.sysconfig
Source2: gsad.logrotate
Source3: gsad.init
Source4: gsad.service
Patch1: openvas-gsa-pki.patch
Patch2: openvas-gsa-gsad_js-fr.patch
Patch3: openvas-gsa-polib.patch
Patch4: openvas-gsa-doxygen_full.patch
Patch5: openvas-gsa-strncpy.patch
License: GNU GPLv2
URL: http://www.openvas.org
Vendor: Greenbone https://www.greenbone.net
Packager: https://www.atomicorp.com
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Prefix: %{_prefix}
Provides: openvas-gsa
BuildRequires: gvm-libs-devel
BuildRequires: flex
BuildRequires: automake libtool
BuildRequires: cmake >= 2.6.0
BuildRequires: gcc, gcc-g++, ccache
# El7
%if 0%{?rhel} == 7
BuildRequires: atomic-libgcrypt, atomic-libgcrypt-devel
BuildRequires: atomic-libgpg-error, atomic-libgpg-error-devel
BuildRequires: atomic-gpgme, atomic-gpgme-devel
BuildRequires: atomic-zlib, atomic-zlib-devel
BuildRequires: cmake3
#BuildRequires: rh-nodejs8
%else
BuildRequires: libgcrypt-devel
%endif
BuildRequires: nodejs
BuildRequires: nodejs-devel
%if 0%{?rhel}
BuildRequires: yarn
%endif
%if 0%{?fedora}
BuildRequires: nodejs-yarn
%endif
BuildRequires: gpgme gpgme-devel
BuildRequires: libmicrohttpd libmicrohttpd-devel libxml2 libxml2-devel
BuildRequires: doxygen
BuildRequires: openvas-smb
Requires: libmicrohttpd
Requires: openvas-scanner, openvas-manager
BuildRequires: libxslt libxslt-devel
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
%endif
Requires: openvas-libraries >= 3.0
Requires: logrotate
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
BuildRequires: libuuid libuuid-devel
%else
BuildRequires: e2fsprogs e2fsprogs-devel
%endif
# OV-7
%if 0%{?rhel} == 6
BuildRequires: atomic-gnutls3-gnutls-devel
BuildRequires: atomic-glib2-glib2-devel
BuildRequires: atomic-libxslt-libxslt-devel
BuildConflicts: gnutls gnutls-devel
Requires: atomic-gnutls3-gnutls atomic-glib2-glib2 atomic-libxslt-libxslt
%else
BuildRequires: gnutls-devel
BuildRequires: glib2 >= 2.6.0, glib2-devel >= 2.6.0,
%endif
BuildRequires: libpcap-devel
%description
The Greenbone Security Assistant (GSA) is a lean web service offering a user
web interface for the Open Vulnerability Assessment System (OpenVAS).
The GSA uses XSL transformation style-sheets that converts OMP responses
from the OpenVAS infrastructure into presentable HTML.
%package doc
Summary: Development documentation for %{name}
BuildRequires: graphviz
%description doc
You can find documentation for development of %{name} under file://%{_docdir}/%{name}-doc.
It can be used with a Browser.
%prep
%setup -q -n gsa-%{version}
%build
export CFLAGS="$RPM_OPT_FLAGS -Werror=unused-but-set-variable -Wno-error=deprecated-declarations"
%if 0%{?rhel} == 7
export CC="gcc -Wl,-rpath,/opt/atomicorp/atomic/root/usr/lib64/,-rpath,/opt/atomicorp/atomic/root/usr/lib64/heimdal/"
export PATH="/opt/atomicorp/atomic/root/usr/bin:$PATH"
export LDFLAGS="-L/opt/atomicorp/atomic/root/usr/lib64/ -lgcrypt -ldl -lgpg-error"
export CFLAGS="$CFLAGS -I/opt/atomicorp/atomic/root/usr/include/"
export PKG_CONFIG_PATH="/opt/atomicorp/atomic/root/usr/lib64/pkgconfig"
export CMAKE_PREFIX_PATH="/opt/atomicorp/atomic/root/"
#source /opt/rh/rh-nodejs8/enable
%endif
%if 0%{?fedora} >= 30
# disable warnings -> error for stringop-truncation for now
export CFLAGS="${CFLAGS} -Wno-error=stringop-truncation"
%endif
%if 0%{?rhel} == 7
cmake3 \
%else
%cmake \
%endif
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DSYSCONFDIR=%{_sysconfdir} \
-DLIBDIR=%{_libdir} \
-DLOCALSTATEDIR=%{_localstatedir}
make %{?_smp_mflags} VERBOSE=1
make doc-full
%install
rm -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/etc/sysconfig/
mkdir -p %{buildroot}/etc/logrotate.d/
%{__install} -D -m 644 %{SOURCE1} %{buildroot}/etc/sysconfig/gsad
%{__install} -D -m 644 %{SOURCE2} %{buildroot}/etc/logrotate.d/gsad
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
%{__install} -Dp -m 644 %{SOURCE4} %{buildroot}/%{_unitdir}/gsad.service
%else
%{__install} -D -m 755 %{SOURCE3} %{buildroot}/%{_sysconfdir}/init.d/gsad
%endif
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/openvas
touch %{buildroot}%{_localstatedir}/log/openvas/gsad.log
# Post cleanup
if [ -d %{buildroot}/usr/etc ]; then
rm -rf %{buildroot}/usr/etc/
fi
#find_lang gsad_xsl
%clean
rm -rf $RPM_BUILD_ROOT
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
%post
%systemd_post gsad.service
%preun
%systemd_preun gsad.service
%postun
%systemd_postun_with_restart gsad.service
%else
%post
if [ $1 = 1 ]; then
/sbin/chkconfig --add gsad
fi
%preun
if [ $1 = 0 ]; then
/sbin/service gsad stop > /dev/null 2>&1 || :
/sbin/chkconfig --del gsad
fi
%postun
if [ $1 = 1 ]; then
/sbin/service gsad condrestart
fi
%endif
#%files -f gsad_xsl.lang
%files
%defattr(-,root,root,-)
%license LICENSE
%config(noreplace) /etc/sysconfig/gsad
%config(noreplace) /etc/gvm/gsad_log.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/gsad
%{_sbindir}/gsad
%{_mandir}/man8/gsad.8*
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
%{_unitdir}/gsad.service
%else
/etc/init.d/gsad
%endif
%dir %{_localstatedir}/log/openvas
%ghost %{_localstatedir}/log/openvas/gsad.log
/usr/share/gvm/*
%files doc
#%doc doc/generated/html/*
%changelog
* Sun Aug 16 2020 Scott R. Shinn <scott@atomicorp.com> - 20.8.0
- Update to 20.8.0
* Sun Apr 7 2019 Scott R. Shinn <scott@atomicorp.com> - 8.0.0
- Update to 8.0.0
* Wed Apr 3 2019 Scott R. Shinn <scott@atomicorp.com> - 7.0.3
- Update to 7.0.3
- Merge elements from Fedora project
* Wed Feb 3 2016 Scott R. Shinn <scott@atomicorp.com> - 6.0.9-24
- Update to 6.0.9
* Wed Jan 13 2016 Scott R. Shinn <scott@atomicorp.com> - 6.0.8-23
- Update to 6.0.8
* Tue Dec 22 2015 Scott R. Shinn <scott@atomicorp.com> - 6.0.7-22
- Update to 6.0.7
* Sat Oct 10 2015 Scott R. Shinn <scott@atomicorp.com> - 6.0.6-21
- Update to 6.0.6
* Mon Aug 3 2015 Scott R. Shinn <scott@atomicorp.com> - 6.0.5-20
- Update to 6.0.5
* Mon Jul 13 2015 Scott R. Shinn <scott@atomicorp.com> - 6.0.4-19
- Update to 6.0.4
* Wed Jun 3 2015 Scott R. Shinn <scott@atomicorp.com> - 6.0.3-18
- Updates for systemd support
* Thu May 28 2015 Scott R. Shinn <scott@atomicorp.com> - 6.0.3-17
- Update to 6.0.3
* Wed Mar 18 2015 Scott R. Shinn <scott@atomicorp.com> - 5.0.6-16
- Update to 5.0.6
* Fri Jan 30 2015 Scott R. Shinn <scott@atomicorp.com> - 5.0.5-15
- Update to 5.0.5
* Mon Nov 17 2014 Scott R. Shinn <scott@atomicorp.com> - 5.0.4-14
- Update to 5.0.4
* Tue Sep 9 2014 Scott R. Shinn <scott@atomicorp.com> - 5.0.3-13
- Update to 5.0.3
* Fri Aug 1 2014 Scott R. Shinn <scott@atomicorp.com> - 5.0.2-12
- Update to 5.0.2
* Thu Jun 19 2014 Scott R. Shinn <scott@atomicorp.com> - 5.0.1-11
- Add -rpath for EL6 builds
* Mon Jun 16 2014 Scott R. Shinn <scott@atomicorp.com> - 5.0.1-9
- Update to 5.0.1
- Add logic for el6
* Mon Jun 9 2014 Scott R. Shinn <scott@atomicorp.com> - 5.0.0-8
- Bugfix for init scripts
* Mon May 5 2014 Scott R. Shinn <scott@atomicorp.com> - 5.0.0-7
- Update to 5.0.0
* Fri Oct 25 2013 Scott R. Shinn <scott@atomicorp.com> - 4.0.2-6
- Update to 4.0.2
* Fri Jun 7 2013 Scott R. Shinn <scott@atomicorp.com> - 4.0.1-5
- Update to 4.0.1
* Thu Apr 18 2013 Scott R. Shinn <scott@atomicorp.com> - 4.0.0-4
- Update to 4.0.0
* Mon Aug 20 2012 Scott R. Shinn <scott@atomicorp.com> - 3.0.3-3
- Update to 3.0.3
* Thu May 10 2012 Scott R. Shinn <scott@atomicorp.com> - 3.0.1-2
- Update to 3.0.1
* Tue Apr 24 2012 Scott R. Shinn <scott@atomicorp.com> - 3.0.0-1
- Update to 3.0.0
* Wed Aug 31 2011 Scott R. Shinn <scott@atomicorp.com> - 2.0.1-4
- Rebuild against newer libmicrohttpd
* Thu Mar 17 2011 Scott R. Shinn <scott@atomicorp.com> - 2.0.1-1
- Update to 2.0.1-1
* Tue Feb 22 2011 Scott R. Shinn <scott@atomicorp.com> - 2.0.0-1
- Update to 2.0.0-1
* Thu Feb 17 2011 Scott R. Shinn <scott@atomicorp.com> - 2.0-0.4
- Update to 2.0rc4
* Tue Feb 1 2011 Scott R. Shinn <scott@atomicorp.com> - 2.0-0.2
- Update to 2.0rc2
* Mon Aug 30 2010 Scott R. Shinn <scott@atomicorp.com> - 1.0.2-1
- Update to 1.0.2
* Mon Aug 2 2010 Scott R. Shinn <scott@atomicorp.com> - 1.0.0-0.1
- Initial build