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