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