]>
Commit | Line | Data |
---|---|---|
ffa39469 | 1 | # TODO: revise our auditd.service vs upstream version |
e5a8c0d8 JB |
2 | # |
3 | # Conditional build: | |
ffa39469 JB |
4 | %bcond_without kerberos5 # do not build with heimdal |
5 | %bcond_without pie # auditd as PIE binary | |
6 | %bcond_without prelude # prelude audisp plugin | |
7 | %bcond_without python # don't build python bindings | |
8 | %bcond_without zos_remote # do not build zos-remote audisp plugin (LDAP dep) | |
e5a8c0d8 | 9 | # |
54697230 | 10 | Summary: User space tools for 2.6 kernel auditing |
7f0a1e1e | 11 | Summary(pl.UTF-8): Narzędzia przestrzeni użytkownika do audytu jąder 2.6 |
54697230 | 12 | Name: audit |
0bd7ba4a | 13 | Version: 2.2.3 |
ffa39469 | 14 | Release: 1 |
ab8f94cb | 15 | License: GPL v2+ |
54697230 JB |
16 | Group: Daemons |
17 | Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz | |
0bd7ba4a | 18 | # Source0-md5: 4cdd3756f7b7122fc1a3e4627f01b446 |
de2a21fd JB |
19 | Source2: %{name}d.init |
20 | Source3: %{name}d.sysconfig | |
6c97be47 | 21 | Source4: %{name}d.service |
80475ae6 | 22 | Patch0: %{name}-install.patch |
b0722891 | 23 | Patch1: %{name}-m4.patch |
61d763d9 | 24 | Patch2: %{name}-nolibs.patch |
220b3c30 | 25 | Patch3: %{name}-no_zos_remote.patch |
ffa39469 | 26 | Patch4: %{name}-systemd-notonly.patch |
0bd7ba4a | 27 | Patch5: %{name}-am.patch |
54697230 JB |
28 | URL: http://people.redhat.com/sgrubb/audit/ |
29 | BuildRequires: autoconf >= 2.59 | |
10583781 | 30 | BuildRequires: automake >= 1:1.9 |
e5a8c0d8 | 31 | %{?with_pie:BuildRequires: gcc >= 5:3.4} |
10583781 | 32 | BuildRequires: glibc-headers >= 6:2.3.6 |
220b3c30 | 33 | %{?with_kerberos5:BuildRequires: heimdal-devel} |
693afa1c | 34 | BuildRequires: libcap-ng-devel |
526a1f46 | 35 | %{?with_prelude:BuildRequires: libprelude-devel} |
54697230 | 36 | BuildRequires: libtool |
61d763d9 | 37 | BuildRequires: libwrap-devel |
d80f3483 | 38 | BuildRequires: linux-libc-headers >= 7:2.6.30 |
220b3c30 | 39 | %{?with_zos_remote:BuildRequires: openldap-devel} |
57f09668 | 40 | %if %{with python} |
84214962 | 41 | BuildRequires: python-devel >= 1:2.5 |
9ee6c1ce | 42 | BuildRequires: rpm-pythonprov |
7e695d35 | 43 | BuildRequires: swig-python |
57f09668 | 44 | %endif |
9a3b9076 | 45 | BuildRequires: rpmbuild(macros) >= 1.623 |
ab8f94cb | 46 | BuildRequires: sed >= 4.0 |
54697230 | 47 | Requires(post,preun): /sbin/chkconfig |
195529ba | 48 | Requires(post,preun,postun): systemd-units >= 38 |
54697230 | 49 | Requires: %{name}-libs = %{version}-%{release} |
96102055 | 50 | Requires: rc-scripts |
195529ba | 51 | Requires: systemd-units >= 38 |
526a1f46 | 52 | Obsoletes: audit-audispd-plugins |
7ede5762 | 53 | Obsoletes: audit-systemd |
54697230 JB |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
55 | ||
56 | %define _sbindir /sbin | |
ab8f94cb JB |
57 | # use /lib, because this path is put in /usr/share/.../settings.py |
58 | %define _libexecdir %{_prefix}/lib | |
54697230 JB |
59 | |
60 | %description | |
61 | The audit package contains the user space utilities for storing and | |
62 | processing the audit records generate by the audit subsystem in the | |
63 | Linux 2.6 kernel. | |
64 | ||
b27e8f95 JR |
65 | %description -l pl.UTF-8 |
66 | Ten pakiet zawiera narzędzia przestrzeni użytkownika do przechowywania | |
67 | i przetwarzania rekordów audytu generowanych przez podsystem audytu w | |
68 | jądrach Linuksa 2.6. | |
54697230 JB |
69 | |
70 | %package libs | |
5a56b716 | 71 | Summary: Dynamic audit libraries |
7f0a1e1e | 72 | Summary(pl.UTF-8): Biblioteki dynamiczne audit |
ab8f94cb | 73 | License: LGPL v2.1+ |
54697230 JB |
74 | Group: Libraries |
75 | ||
76 | %description libs | |
5a56b716 | 77 | The audit-libs package contains the dynamic libraries needed for |
54697230 JB |
78 | applications to use the audit framework. |
79 | ||
b27e8f95 | 80 | %description libs -l pl.UTF-8 |
5a56b716 | 81 | Ten pakiet zawiera biblioteki dynamiczne potrzebne dla aplikacji |
b27e8f95 | 82 | używających środowiska audytu. |
54697230 JB |
83 | |
84 | %package libs-devel | |
5a56b716 | 85 | Summary: Header files for audit libraries |
7f0a1e1e | 86 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek audit |
ab8f94cb | 87 | License: LGPL v2.1+ |
54697230 JB |
88 | Group: Development/Libraries |
89 | Requires: %{name}-libs = %{version}-%{release} | |
d80f3483 | 90 | Requires: linux-libc-headers >= 7:2.6.30 |
54697230 JB |
91 | |
92 | %description libs-devel | |
93 | The audit-libs-devel package contains the header files needed for | |
94 | developing applications that need to use the audit framework library. | |
95 | ||
b27e8f95 JR |
96 | %description libs-devel -l pl.UTF-8 |
97 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia aplikacji | |
98 | używających biblioteki środowiska audytu. | |
54697230 JB |
99 | |
100 | %package libs-static | |
5a56b716 | 101 | Summary: Static audit libraries |
7f0a1e1e | 102 | Summary(pl.UTF-8): Statyczne biblioteki audit |
ab8f94cb | 103 | License: LGPL v2.1+ |
54697230 JB |
104 | Group: Development/Libraries |
105 | Requires: %{name}-libs-devel = %{version}-%{release} | |
106 | ||
107 | %description libs-static | |
5a56b716 JB |
108 | The audit-libs-static package contains the static libraries for |
109 | developing applications that need to use the audit framework. | |
54697230 | 110 | |
b27e8f95 | 111 | %description libs-static -l pl.UTF-8 |
5a56b716 | 112 | Ten pakiet zawiera statyczne biblioteki do tworzenia aplikacji |
b27e8f95 | 113 | używających środowiska audytu. |
54697230 | 114 | |
526a1f46 JB |
115 | %package plugin-prelude |
116 | Summary: prelude plugin for audispd | |
117 | Summary(pl.UTF-8): Wtyczka prelude dla audispd | |
118 | Group: Daemons | |
119 | Requires: %{name} = %{version}-%{release} | |
120 | ||
121 | %description plugin-prelude | |
122 | audisp-prelude is a plugin for the audit event dispatcher daemon, | |
123 | audispd, that uses libprelude to send IDMEF alerts for possible | |
124 | Intrusion Detection events. | |
125 | ||
126 | %description plugin-prelude -l pl.UTF-8 | |
127 | audisp-prelude to wtyczka demona audispd przekazującego zdarzenia | |
128 | audytowe wykorzystująca libprelude do wysyłania alarmów IDMEF o | |
129 | prawdopodobnych zdarzeniach IDS. | |
130 | ||
9ee6c1ce JB |
131 | %package -n python-audit |
132 | Summary: Python interface to libaudit library | |
7f0a1e1e | 133 | Summary(pl.UTF-8): Pythonowy interfejs do biblioteki libaudit |
ab8f94cb | 134 | License: LGPL v2.1+ |
9ee6c1ce JB |
135 | Group: Libraries/Python |
136 | Requires: %{name}-libs = %{version}-%{release} | |
137 | ||
138 | %description -n python-audit | |
139 | Python interface to libaudit library. | |
140 | ||
b27e8f95 | 141 | %description -n python-audit -l pl.UTF-8 |
9ee6c1ce JB |
142 | Pythonowy interfejs do biblioteki libaudit. |
143 | ||
54697230 JB |
144 | %prep |
145 | %setup -q | |
eb9b3ab9 | 146 | %patch0 -p1 |
1e78f2d9 | 147 | %patch1 -p1 |
61d763d9 | 148 | %patch2 -p1 |
220b3c30 | 149 | %{!?with_zos_remote:%patch3 -p1} |
ffa39469 | 150 | %patch4 -p1 |
0bd7ba4a | 151 | %patch5 -p1 |
1a8b063a | 152 | |
68d62ac9 | 153 | %if %{without python} |
b89f6d79 | 154 | sed 's#swig/Makefile ##' -i configure.ac |
9d3991e5 | 155 | sed 's/swig//' -i Makefile.am |
57f09668 | 156 | %endif |
157 | ||
54697230 JB |
158 | %build |
159 | %{__libtoolize} | |
160 | %{__aclocal} | |
161 | %{__autoconf} | |
162 | %{__autoheader} | |
163 | %{__automake} | |
cc094a3e | 164 | %configure \ |
220b3c30 | 165 | %{?with_kerberos5:--enable-gssapi-krb5} \ |
ffa39469 | 166 | --enable-systemd \ |
61d763d9 JB |
167 | --with-apparmor \ |
168 | --with-libwrap \ | |
526a1f46 | 169 | %{?with_prelude:--with-prelude} |
e5a8c0d8 JB |
170 | # override auditd_{C,LD}FLAGS to avoid -fPIE unsupported by gcc 3.3 |
171 | %{__make} \ | |
aac5fae1 | 172 | %{!?with_pie:auditd_CFLAGS="-D_REENTRANT -D_GNU_SOURCE" auditd_LDFLAGS="-Wl,-z,relro"} |
54697230 | 173 | |
bf2e6acc JB |
174 | # temporarily not included in all |
175 | %{__make} -C auparse | |
176 | ||
54697230 JB |
177 | %install |
178 | rm -rf $RPM_BUILD_ROOT | |
179 | install -d $RPM_BUILD_ROOT%{_var}/log/audit | |
180 | ||
181 | %{__make} install \ | |
182 | DESTDIR=$RPM_BUILD_ROOT | |
183 | ||
bf2e6acc JB |
184 | # temporarily not included in all |
185 | %{__make} -C auparse install \ | |
186 | DESTDIR=$RPM_BUILD_ROOT | |
187 | ||
54697230 JB |
188 | install -d $RPM_BUILD_ROOT/%{_lib} |
189 | mv -f $RPM_BUILD_ROOT%{_libdir}/libaudit.so.* $RPM_BUILD_ROOT/%{_lib} | |
fef538cf | 190 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libaudit.so.*.*.*) \ |
1a8b063a | 191 | $RPM_BUILD_ROOT%{_libdir}/libaudit.so |
8ba70267 | 192 | mv -f $RPM_BUILD_ROOT%{_libdir}/libauparse.so.* $RPM_BUILD_ROOT/%{_lib} |
fef538cf | 193 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libauparse.so.*.*.*) \ |
8ba70267 | 194 | $RPM_BUILD_ROOT%{_libdir}/libauparse.so |
54697230 JB |
195 | |
196 | # We manually install this since Makefile doesn't | |
9a3b9076 | 197 | install -d $RPM_BUILD_ROOT{%{_includedir},%{systemdunitdir}} |
54697230 JB |
198 | install lib/libaudit.h $RPM_BUILD_ROOT%{_includedir} |
199 | ||
de2a21fd JB |
200 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/auditd |
201 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/auditd | |
9a3b9076 | 202 | install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir} |
de2a21fd | 203 | |
57f09668 | 204 | %if %{with python} |
68d62ac9 JB |
205 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
206 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
207 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.py | |
208 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.{la,a} | |
57f09668 | 209 | %endif |
9ee6c1ce | 210 | |
54697230 JB |
211 | %clean |
212 | rm -rf $RPM_BUILD_ROOT | |
213 | ||
214 | %post libs -p /sbin/ldconfig | |
215 | %postun libs -p /sbin/ldconfig | |
216 | ||
217 | %post | |
218 | /sbin/chkconfig --add auditd | |
2a6b8c9c | 219 | %service auditd restart "audit daemon" |
7ede5762 | 220 | %systemd_post auditd.service |
54697230 JB |
221 | |
222 | %preun | |
223 | if [ "$1" = "0" ]; then | |
2a6b8c9c | 224 | %service auditd stop |
54697230 JB |
225 | /sbin/chkconfig --del auditd |
226 | fi | |
9a3b9076 BZ |
227 | %systemd_preun auditd.service |
228 | ||
7ede5762 JR |
229 | %postun |
230 | %systemd_reload | |
231 | ||
232 | %triggerpostun -- %{name} < 2.2-2 | |
233 | %systemd_trigger auditd.service | |
9a3b9076 | 234 | |
54697230 JB |
235 | %files |
236 | %defattr(644,root,root,755) | |
bd0730be | 237 | %doc AUTHORS ChangeLog README THANKS TODO |
2bfdaebd | 238 | %attr(750,root,root) %{_bindir}/aulast |
08b12da9 JB |
239 | %attr(750,root,root) %{_bindir}/aulastlog |
240 | %attr(750,root,root) %{_bindir}/ausyscall | |
d80f3483 | 241 | %attr(750,root,root) %{_bindir}/auvirt |
80475ae6 | 242 | %attr(750,root,root) %{_sbindir}/audispd |
54697230 JB |
243 | %attr(750,root,root) %{_sbindir}/auditctl |
244 | %attr(750,root,root) %{_sbindir}/auditd | |
e5a8c0d8 | 245 | %attr(750,root,root) %{_sbindir}/aureport |
54697230 JB |
246 | %attr(750,root,root) %{_sbindir}/ausearch |
247 | %attr(750,root,root) %{_sbindir}/autrace | |
08b12da9 | 248 | %attr(755,root,root) %{_sbindir}/audisp-remote |
ffa39469 | 249 | %{?with_zos_remote:%attr(755,root,root) %{_sbindir}/audispd-zos-remote} |
0a348a92 JB |
250 | %dir %{_sysconfdir}/audisp |
251 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/audispd.conf | |
08b12da9 | 252 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/audisp-remote.conf |
ffa39469 | 253 | %{?with_zos_remote:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/zos-remote.conf} |
0a348a92 JB |
254 | %dir %{_sysconfdir}/audisp/plugins.d |
255 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/af_unix.conf | |
08b12da9 | 256 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/au-remote.conf |
ffa39469 | 257 | %{?with_zos_remote:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/audispd-zos-remote.conf} |
0a348a92 | 258 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/syslog.conf |
7630c8d3 JB |
259 | %dir %{_sysconfdir}/audit |
260 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/auditd.conf | |
261 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/audit.rules | |
80475ae6 | 262 | %attr(754,root,root) /etc/rc.d/init.d/auditd |
f6ae0a53 | 263 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/auditd |
7ede5762 | 264 | %{systemdunitdir}/auditd.service |
54697230 | 265 | %attr(750,root,root) %dir %{_var}/log/audit |
0a348a92 | 266 | %{_mandir}/man5/audispd.conf.5* |
08b12da9 | 267 | %{_mandir}/man5/audisp-remote.conf.5* |
80475ae6 | 268 | %{_mandir}/man5/auditd.conf.5* |
526a1f46 | 269 | %{_mandir}/man5/ausearch-expression.5* |
ffa39469 | 270 | %{?with_zos_remote:%{_mandir}/man5/zos-remote.conf.5*} |
693afa1c | 271 | %{_mandir}/man7/audit.rules.7* |
08b12da9 | 272 | %{_mandir}/man8/audisp-remote.8* |
ffa39469 | 273 | %{?with_zos_remote:%{_mandir}/man8/audispd-zos-remote.8*} |
526a1f46 JB |
274 | %{_mandir}/man8/audispd.8* |
275 | %{_mandir}/man8/auditctl.8* | |
276 | %{_mandir}/man8/auditd.8* | |
2bfdaebd | 277 | %{_mandir}/man8/aulast.8* |
526a1f46 JB |
278 | %{_mandir}/man8/aulastlog.8* |
279 | %{_mandir}/man8/aureport.8* | |
280 | %{_mandir}/man8/ausearch.8* | |
08b12da9 | 281 | %{_mandir}/man8/ausyscall.8* |
526a1f46 | 282 | %{_mandir}/man8/autrace.8* |
d80f3483 | 283 | %{_mandir}/man8/auvirt.8* |
54697230 JB |
284 | |
285 | %files libs | |
286 | %defattr(644,root,root,755) | |
287 | %attr(755,root,root) /%{_lib}/libaudit.so.*.*.* | |
82313177 | 288 | %attr(755,root,root) %ghost /%{_lib}/libaudit.so.1 |
8ba70267 | 289 | %attr(755,root,root) /%{_lib}/libauparse.so.*.*.* |
fef538cf | 290 | %attr(755,root,root) %ghost /%{_lib}/libauparse.so.0 |
7630c8d3 | 291 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libaudit.conf |
693afa1c | 292 | %{_mandir}/man5/libaudit.conf.5* |
54697230 JB |
293 | |
294 | %files libs-devel | |
295 | %defattr(644,root,root,755) | |
296 | %attr(755,root,root) %{_libdir}/libaudit.so | |
8ba70267 | 297 | %attr(755,root,root) %{_libdir}/libauparse.so |
54697230 | 298 | %{_libdir}/libaudit.la |
8ba70267 | 299 | %{_libdir}/libauparse.la |
6d3a6f20 | 300 | %{_includedir}/auparse*.h |
54697230 | 301 | %{_includedir}/libaudit.h |
526a1f46 JB |
302 | %{_mandir}/man3/audit_*.3* |
303 | %{_mandir}/man3/auparse_*.3* | |
304 | %{_mandir}/man3/ausearch_*.3* | |
305 | %{_mandir}/man3/get_auditfail_action.3* | |
306 | %{_mandir}/man3/set_aumessage_mode.3* | |
54697230 JB |
307 | |
308 | %files libs-static | |
309 | %defattr(644,root,root,755) | |
310 | %{_libdir}/libaudit.a | |
8ba70267 | 311 | %{_libdir}/libauparse.a |
9ee6c1ce | 312 | |
526a1f46 JB |
313 | %if %{with prelude} |
314 | %files plugin-prelude | |
315 | %defattr(644,root,root,755) | |
316 | %attr(755,root,root) %{_sbindir}/audisp-prelude | |
317 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/audisp-prelude.conf | |
318 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audisp/plugins.d/au-prelude.conf | |
319 | %{_mandir}/man5/audisp-prelude.conf.5* | |
320 | %{_mandir}/man8/audisp-prelude.8* | |
321 | %endif | |
322 | ||
57f09668 | 323 | %if %{with python} |
9ee6c1ce JB |
324 | %files -n python-audit |
325 | %defattr(644,root,root,755) | |
326 | %attr(755,root,root) %{py_sitedir}/_audit.so | |
84214962 | 327 | %attr(755,root,root) %{py_sitedir}/auparse.so |
4c11c375 | 328 | %{py_sitedir}/audit.py[co] |
57f09668 | 329 | %endif |