]> git.pld-linux.org Git - packages/audit.git/blob - audit.spec
rebuild with python 3.10
[packages/audit.git] / audit.spec
1 #
2 # Conditional build:
3 %bcond_without  kerberos5       # Kerberos V support via heimdal
4 %bcond_without  prelude         # prelude audisp plugin
5 %bcond_without  golang          # Go language bindings
6 %bcond_with     gccgo           # use GCC go frontend instead of golang implementation
7 %bcond_without  python          # Python bindings (any)
8 %bcond_without  python2         # Python 2 bindings
9 %bcond_without  python3         # Python 3 bindings
10 %bcond_without  zos_remote      # zos-remote audisp plugin (LDAP dep)
11
12 %ifnarch %{ix86} %{x8664} %{arm} aarch64 mips64 mips64le ppc64 ppc64le s390x
13 %define         with_gccgo      1
14 %endif
15
16 %if %{without python}
17 %undefine       with_python2
18 %undefine       with_python3
19 %endif
20 Summary:        User space tools for 2.6 kernel auditing
21 Summary(pl.UTF-8):      Narzędzia przestrzeni użytkownika do audytu jąder 2.6
22 Name:           audit
23 Version:        2.8.5
24 Release:        4
25 License:        GPL v2+
26 Group:          Daemons
27 Source0:        https://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz
28 # Source0-md5:  9455e5773670afdbccaeb92681b2e97d
29 Source2:        %{name}d.init
30 Source3:        %{name}d.sysconfig
31 Patch0:         %{name}-install.patch
32 Patch1:         %{name}-m4.patch
33 Patch2:         %{name}-nolibs.patch
34 Patch3:         %{name}-systemd-notonly.patch
35 Patch4:         %{name}-am.patch
36 Patch5:         %{name}-no-refusemanualstop.patch
37 Patch6:         %{name}-cronjob.patch
38 Patch7:         golang-paths.patch
39 Patch8:         gcc10.patch
40 URL:            http://people.redhat.com/sgrubb/audit/
41 BuildRequires:  autoconf >= 2.59
42 BuildRequires:  automake >= 1:1.12.6
43 BuildRequires:  glibc-headers >= 6:2.3.6
44 %{?with_kerberos5:BuildRequires:        heimdal-devel}
45 BuildRequires:  libcap-ng-devel
46 %{?with_prelude:BuildRequires:  libprelude-devel}
47 BuildRequires:  libtool
48 BuildRequires:  libwrap-devel
49 BuildRequires:  linux-libc-headers >= 7:2.6.30
50 %{?with_zos_remote:BuildRequires:       openldap-devel}
51 %if %{with python2}
52 BuildRequires:  python-devel >= 1:2.5
53 BuildRequires:  rpm-pythonprov
54 BuildRequires:  swig-python
55 %endif
56 %if %{with python3}
57 BuildRequires:  python3-devel
58 BuildRequires:  rpm-pythonprov
59 BuildRequires:  swig-python
60 %endif
61 BuildRequires:  rpmbuild(macros) >= 1.644
62 BuildRequires:  sed >= 4.0
63 %if %{with golang}
64 %{?with_gccgo:BuildRequires:    gcc-go >= 5.1}
65 %{!?with_gccgo:BuildRequires:   golang >= 1.4}
66 %endif
67 Requires(post,preun):   /sbin/chkconfig
68 Requires(post,preun,postun):    systemd-units >= 38
69 Requires:       %{name}-libs = %{version}-%{release}
70 Requires:       rc-scripts
71 Requires:       systemd-units >= 38
72 Obsoletes:      audit-audispd-plugins
73 Obsoletes:      audit-systemd
74 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75
76 %define         _sbindir        /sbin
77 # use /lib, because this path is put in /usr/share/.../settings.py
78 %define         _libexecdir     %{_prefix}/lib
79
80 %description
81 The audit package contains the user space utilities for storing and
82 processing the audit records generate by the audit subsystem in the
83 Linux 2.6 kernel.
84
85 %description -l pl.UTF-8
86 Ten pakiet zawiera narzędzia przestrzeni użytkownika do przechowywania
87 i przetwarzania rekordów audytu generowanych przez podsystem audytu w
88 jądrach Linuksa 2.6.
89
90 %package libs
91 Summary:        Dynamic audit libraries
92 Summary(pl.UTF-8):      Biblioteki dynamiczne audit
93 License:        LGPL v2.1+
94 Group:          Libraries
95
96 %description libs
97 The audit-libs package contains the dynamic libraries needed for
98 applications to use the audit framework.
99
100 %description libs -l pl.UTF-8
101 Ten pakiet zawiera biblioteki dynamiczne potrzebne dla aplikacji
102 używających środowiska audytu.
103
104 %package libs-devel
105 Summary:        Header files for audit libraries
106 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek audit
107 License:        LGPL v2.1+
108 Group:          Development/Libraries
109 Requires:       %{name}-libs = %{version}-%{release}
110 Requires:       linux-libc-headers >= 7:2.6.30
111 Requires:       libcap-ng-devel
112
113 %description libs-devel
114 The audit-libs-devel package contains the header files needed for
115 developing applications that need to use the audit framework library.
116
117 %description libs-devel -l pl.UTF-8
118 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia aplikacji
119 używających biblioteki środowiska audytu.
120
121 %package libs-static
122 Summary:        Static audit libraries
123 Summary(pl.UTF-8):      Statyczne biblioteki audit
124 License:        LGPL v2.1+
125 Group:          Development/Libraries
126 Requires:       %{name}-libs-devel = %{version}-%{release}
127
128 %description libs-static
129 The audit-libs-static package contains the static libraries for
130 developing applications that need to use the audit framework.
131
132 %description libs-static -l pl.UTF-8
133 Ten pakiet zawiera statyczne biblioteki do tworzenia aplikacji
134 używających środowiska audytu.
135
136 %package plugin-prelude
137 Summary:        prelude plugin for audispd
138 Summary(pl.UTF-8):      Wtyczka prelude dla audispd
139 Group:          Daemons
140 Requires:       %{name} = %{version}-%{release}
141
142 %description plugin-prelude
143 audisp-prelude is a plugin for the audit event dispatcher daemon,
144 audispd, that uses libprelude to send IDMEF alerts for possible
145 Intrusion Detection events.
146
147 %description plugin-prelude -l pl.UTF-8
148 audisp-prelude to wtyczka demona audispd przekazującego zdarzenia
149 audytowe wykorzystująca libprelude do wysyłania alarmów IDMEF o
150 prawdopodobnych zdarzeniach IDS.
151
152 %package -n golang-audit
153 Summary:        Go language interface to libaudit library
154 Summary(pl.UTF-8):      Interfejs języka Go do biblioteki libaudit
155 License:        LGPL v2.1+
156 Group:          Development/Languages
157 Requires:       %{name}-libs = %{version}-%{release}
158 %if %{with gccgo}
159 Requires:       gcc-go >= 5.1
160 %else
161 Requires:       golang >= 1.4
162 %endif
163
164 %description -n golang-audit
165 Go language interface to libaudit library.
166
167 %description -n golang-audit -l pl.UTF-8
168 Interfejs języka Go do biblioteki libaudit.
169
170 %package -n python-audit
171 Summary:        Python 2.x interface to libaudit library
172 Summary(pl.UTF-8):      Interfejs Pythona 2.x do biblioteki libaudit
173 License:        LGPL v2.1+
174 Group:          Libraries/Python
175 Requires:       %{name}-libs = %{version}-%{release}
176
177 %description -n python-audit
178 Python 2.x interface to libaudit library.
179
180 %description -n python-audit -l pl.UTF-8
181 Interfejs Pythona 2.x do biblioteki libaudit.
182
183 %package -n python3-audit
184 Summary:        Python 3.x interface to libaudit library
185 Summary(pl.UTF-8):      Interfejs Pythona 3.x do biblioteki libaudit
186 License:        LGPL v2.1+
187 Group:          Libraries/Python
188 Requires:       %{name}-libs = %{version}-%{release}
189
190 %description -n python3-audit
191 Python 3.x interface to libaudit library.
192
193 %description -n python3-audit -l pl.UTF-8
194 Interfejs Pythona 3.x do biblioteki libaudit.
195
196 %prep
197 %setup -q
198 %patch0 -p1
199 %patch1 -p1
200 %patch2 -p1
201 %patch3 -p1
202 %patch4 -p1
203 %patch5 -p1
204 %patch6 -p1
205 %patch7 -p1
206 %patch8 -p1
207
208 %if %{without python}
209 sed 's#[^ ]*swig/[^ ]*/Makefile ##g' -i configure.ac
210 sed 's/swig//' -i bindings/Makefile.am
211 %endif
212
213 %build
214 %{__libtoolize}
215 %{__aclocal}
216 %{__autoconf}
217 %{__autoheader}
218 %{__automake}
219 %configure \
220         CC_FOR_BUILD="%{__cc}" \
221         CPPFLAGS_FOR_BUILD="%{rpmcppflags}" \
222         CFLAGS_FOR_BUILD="%{rpmcflags}" \
223         LDFLAGS_FOR_BUILD="%{rpmldflags}" \
224         %{?with_kerberos5:--enable-gssapi-krb5} \
225         --enable-systemd \
226         --with-apparmor \
227         --with-libwrap \
228         %{?with_prelude:--with-prelude} \
229         %{!?with_zos_remote:--disable-zos-remote}
230
231 %{__make}
232
233 %install
234 rm -rf $RPM_BUILD_ROOT
235 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/audit/rules.d,%{_var}/log/audit}
236
237 %{__make} install \
238         DESTDIR=$RPM_BUILD_ROOT
239
240 # default to no audit (and no overhead)
241 cp -p rules/10-no-audit.rules $RPM_BUILD_ROOT%{_sysconfdir}/audit/rules.d
242
243 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/auditd
244 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/auditd
245
246 install -d $RPM_BUILD_ROOT/%{_lib}
247 mv -f $RPM_BUILD_ROOT%{_libdir}/libaudit.so.* $RPM_BUILD_ROOT/%{_lib}
248 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libaudit.so.*.*.*) \
249         $RPM_BUILD_ROOT%{_libdir}/libaudit.so
250 mv -f $RPM_BUILD_ROOT%{_libdir}/libauparse.so.* $RPM_BUILD_ROOT/%{_lib}
251 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libauparse.so.*.*.*) \
252         $RPM_BUILD_ROOT%{_libdir}/libauparse.so
253
254 # RH initscripts-specific
255 %{__rm} -r $RPM_BUILD_ROOT%{_libexecdir}/initscripts
256
257 %if %{with python2}
258 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
259 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
260 %py_postclean
261 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.{la,a}
262 %endif
263
264 %if %{with python3}
265 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.{la,a}
266 %endif
267
268 %clean
269 rm -rf $RPM_BUILD_ROOT
270
271 %post   libs -p /sbin/ldconfig
272 %postun libs -p /sbin/ldconfig
273
274 %post
275 # Copy default rules into place on new installation
276 if [ ! -e %{_sysconfdir}/audit/audit.rules ] ; then
277         cp -a %{_sysconfdir}/audit/rules.d/10-no-audit.rules %{_sysconfdir}/audit/audit.rules
278 fi
279 /sbin/chkconfig --add auditd
280 %service auditd restart "audit daemon"
281 %systemd_post auditd.service
282
283 %preun
284 if [ "$1" = "0" ]; then
285         %service auditd stop
286         /sbin/chkconfig --del auditd
287 fi
288 %systemd_preun auditd.service
289
290 %postun
291 %systemd_reload
292
293 %triggerpostun -- %{name} < 2.2-2
294 %systemd_trigger auditd.service
295
296 %triggerpostun -- %{name} < 2.3-1
297 if [ -e %{_sysconfdir}/audit/audit.rules.rpmsave ] ; then
298         %{__mv} %{_sysconfdir}/audit/audit.rules{.rpmsave,}
299 fi
300 %service auditd restart "audit daemon"
301 %systemd_post auditd.service
302
303 %triggerpostun -- %{name} < 2.5-1
304 if [ -f %{_sysconfdir}/audit/rules.d/audit.rules.rpmsave ]; then
305 %banner %{name} -e <<EOF
306 Since audit 2.5 %{_sysconfdir}/audit/rules.d/audit.rules file (now saved
307 as audit.rules.rpmnew) is replaced by a set of numbered rule files - remember
308 to update your configuration!
309 EOF
310 fi
311
312 %files
313 %defattr(644,root,root,755)
314 %doc AUTHORS ChangeLog README THANKS rules/{README-rules,*.rules} init.d/auditd.cron
315 %attr(750,root,root) %{_bindir}/aulast
316 %attr(750,root,root) %{_bindir}/aulastlog
317 %attr(750,root,root) %{_bindir}/ausyscall
318 %attr(750,root,root) %{_bindir}/auvirt
319 %attr(750,root,root) %{_sbindir}/audispd
320 %attr(750,root,root) %{_sbindir}/auditctl
321 %attr(750,root,root) %{_sbindir}/auditd
322 %attr(750,root,root) %{_sbindir}/augenrules
323 %attr(750,root,root) %{_sbindir}/aureport
324 %attr(750,root,root) %{_sbindir}/ausearch
325 %attr(750,root,root) %{_sbindir}/autrace
326 %attr(755,root,root) %{_sbindir}/audisp-remote
327 %{?with_zos_remote:%attr(755,root,root) %{_sbindir}/audispd-zos-remote}
328 %dir %{_sysconfdir}/audisp
329 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/audispd.conf
330 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/audisp-remote.conf
331 %{?with_zos_remote:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/zos-remote.conf}
332 %dir %{_sysconfdir}/audisp/plugins.d
333 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/af_unix.conf
334 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/au-remote.conf
335 %{?with_zos_remote:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/audispd-zos-remote.conf}
336 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/syslog.conf
337 %dir %{_sysconfdir}/audit
338 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/audit-stop.rules
339 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/auditd.conf
340 %dir %{_sysconfdir}/audit/rules.d
341 %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/audit/rules.d/10-no-audit.rules
342 %attr(754,root,root) /etc/rc.d/init.d/auditd
343 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/auditd
344 %{systemdunitdir}/auditd.service
345 %attr(750,root,root) %dir %{_var}/log/audit
346 %{_mandir}/man5/audispd.conf.5*
347 %{_mandir}/man5/audisp-remote.conf.5*
348 %{_mandir}/man5/auditd.conf.5*
349 %{_mandir}/man5/ausearch-expression.5*
350 %{?with_zos_remote:%{_mandir}/man5/zos-remote.conf.5*}
351 %{_mandir}/man7/audit.rules.7*
352 %{_mandir}/man8/audisp-remote.8*
353 %{?with_zos_remote:%{_mandir}/man8/audispd-zos-remote.8*}
354 %{_mandir}/man8/audispd.8*
355 %{_mandir}/man8/auditctl.8*
356 %{_mandir}/man8/auditd.8*
357 %{_mandir}/man8/augenrules.8*
358 %{_mandir}/man8/aulast.8*
359 %{_mandir}/man8/aulastlog.8*
360 %{_mandir}/man8/aureport.8*
361 %{_mandir}/man8/ausearch.8*
362 %{_mandir}/man8/ausyscall.8*
363 %{_mandir}/man8/autrace.8*
364 %{_mandir}/man8/auvirt.8*
365
366 %files libs
367 %defattr(644,root,root,755)
368 %attr(755,root,root) /%{_lib}/libaudit.so.*.*.*
369 %attr(755,root,root) %ghost /%{_lib}/libaudit.so.1
370 %attr(755,root,root) /%{_lib}/libauparse.so.*.*.*
371 %attr(755,root,root) %ghost /%{_lib}/libauparse.so.0
372 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libaudit.conf
373 %{_mandir}/man5/libaudit.conf.5*
374
375 %files libs-devel
376 %defattr(644,root,root,755)
377 %attr(755,root,root) %{_libdir}/libaudit.so
378 %attr(755,root,root) %{_libdir}/libauparse.so
379 %{_libdir}/libaudit.la
380 %{_libdir}/libauparse.la
381 %{_includedir}/auparse*.h
382 %{_includedir}/libaudit.h
383 %{_pkgconfigdir}/audit.pc
384 %{_pkgconfigdir}/auparse.pc
385 %{_aclocaldir}/audit.m4
386 %{_mandir}/man3/audit_*.3*
387 %{_mandir}/man3/auparse_*.3*
388 %{_mandir}/man3/ausearch_*.3*
389 %{_mandir}/man3/get_auditfail_action.3*
390 %{_mandir}/man3/set_aumessage_mode.3*
391
392 %files libs-static
393 %defattr(644,root,root,755)
394 %{_libdir}/libaudit.a
395 %{_libdir}/libauparse.a
396
397 %if %{with prelude}
398 %files plugin-prelude
399 %defattr(644,root,root,755)
400 %attr(755,root,root) %{_sbindir}/audisp-prelude
401 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/audisp-prelude.conf
402 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/au-prelude.conf
403 %{_mandir}/man5/audisp-prelude.conf.5*
404 %{_mandir}/man8/audisp-prelude.8*
405 %endif
406
407 %if %{with golang}
408 %files -n golang-audit
409 %defattr(644,root,root,755)
410 %dir %{_libdir}/golang/src/redhat.com
411 %{_libdir}/golang/src/redhat.com/audit
412 %endif
413
414 %if %{with python2}
415 %files -n python-audit
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{py_sitedir}/_audit.so
418 %attr(755,root,root) %{py_sitedir}/auparse.so
419 %{py_sitedir}/audit.py[co]
420 %endif
421
422 %if %{with python3}
423 %files -n python3-audit
424 %defattr(644,root,root,755)
425 %attr(755,root,root) %{py3_sitedir}/_audit.so
426 %attr(755,root,root) %{py3_sitedir}/auparse.so
427 %{py3_sitedir}/audit.py
428 %{py3_sitedir}/__pycache__/audit.cpython-*.py[co]
429 %endif
This page took 0.092698 seconds and 3 git commands to generate.