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