3 %bcond_without pie # auditd as PIE binary
4 %bcond_without python # don't build python bindings
6 Summary: User space tools for 2.6 kernel auditing
7 Summary(pl): Narzêdzia przestrzeni u¿ytkownika do audytu j±der 2.6
13 Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz
14 # Source0-md5: 2cb76a573b332ef4eb08351d9408b6cf
15 # formerly http://people.redhat.com/sgrubb/audit/audit.h
17 Source2: %{name}d.init
18 Source3: %{name}d.sysconfig
19 Patch0: %{name}-swig-fix.patch
20 Patch1: %{name}-install.patch
21 URL: http://people.redhat.com/sgrubb/audit/
22 BuildRequires: autoconf >= 2.59
23 BuildRequires: automake >= 1:1.9
24 %{?with_pie:BuildRequires: gcc >= 5:3.4}
25 BuildRequires: glibc-headers >= 6:2.3.6
26 BuildRequires: libstdc++-devel
27 BuildRequires: libtool
28 BuildRequires: linux-libc-headers >= 2.6.11
30 BuildRequires: rpm-pythonprov
31 BuildRequires: swig-python
33 BuildRequires: sed >= 4.0
35 BuildRequires: rpmbuild(macros) >= 1.268
36 Requires(post,preun): /sbin/chkconfig
37 Requires: %{name}-libs = %{version}-%{release}
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define _sbindir /sbin
44 The audit package contains the user space utilities for storing and
45 processing the audit records generate by the audit subsystem in the
49 Ten pakiet zawiera narzêdzia przestrzeni u¿ytkownika do przechowywania
50 i przetwarzania rekordów audytu generowanych przez podsystem audytu w
54 Summary: Dynamic audit libraries
55 Summary(pl): Biblioteki dynamiczne audit
60 The audit-libs package contains the dynamic libraries needed for
61 applications to use the audit framework.
63 %description libs -l pl
64 Ten pakiet zawiera biblioteki dynamiczne potrzebne dla aplikacji
65 u¿ywaj±cych ¶rodowiska audytu.
68 Summary: Header files for audit libraries
69 Summary(pl): Pliki nag³ówkowe bibliotek audit
71 Group: Development/Libraries
72 Requires: %{name}-libs = %{version}-%{release}
73 Requires: linux-libc-headers >= 7:2.6.12.0-4
75 %description libs-devel
76 The audit-libs-devel package contains the header files needed for
77 developing applications that need to use the audit framework library.
79 %description libs-devel -l pl
80 Ten pakiet zawiera pliki nag³ówkowe potrzebne do tworzenia aplikacji
81 u¿ywaj±cych biblioteki ¶rodowiska audytu.
84 Summary: Static audit libraries
85 Summary(pl): Statyczne biblioteki audit
87 Group: Development/Libraries
88 Requires: %{name}-libs-devel = %{version}-%{release}
90 %description libs-static
91 The audit-libs-static package contains the static libraries for
92 developing applications that need to use the audit framework.
94 %description libs-static -l pl
95 Ten pakiet zawiera statyczne biblioteki do tworzenia aplikacji
96 u¿ywaj±cych ¶rodowiska audytu.
98 %package -n python-audit
99 Summary: Python interface to libaudit library
100 Summary(pl): Pythonowy interfejs do biblioteki libaudit
102 Group: Libraries/Python
103 Requires: %{name}-libs = %{version}-%{release}
105 %description -n python-audit
106 Python interface to libaudit library.
108 %description -n python-audit -l pl
109 Pythonowy interfejs do biblioteki libaudit.
116 install -D %{SOURCE1} lib/linux/audit.h
117 install -D %{SOURCE1} src/mt/linux/audit.h
120 sed '/PYTHON/d; s#swig/Makefile ##' -i configure.ac
121 sed 's/swig//' -i Makefile.am
131 # override auditd_{C,LD}FLAGS to avoid -fPIE unsupported by gcc 3.3
133 %{!?with_pie:auditd_CFLAGS="-D_REENTRANT -D_GNU_SOURCE" auditd_LDFLAGS="-Wl,-z,relro"}
135 # temporarily not included in all
139 rm -rf $RPM_BUILD_ROOT
140 install -d $RPM_BUILD_ROOT%{_var}/log/audit
143 DESTDIR=$RPM_BUILD_ROOT
145 # temporarily not included in all
146 %{__make} -C auparse install \
147 DESTDIR=$RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT/%{_lib}
150 mv -f $RPM_BUILD_ROOT%{_libdir}/libaudit.so.* $RPM_BUILD_ROOT/%{_lib}
151 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libaudit.so.*.*.*) \
152 $RPM_BUILD_ROOT%{_libdir}/libaudit.so
153 mv -f $RPM_BUILD_ROOT%{_libdir}/libauparse.so.* $RPM_BUILD_ROOT/%{_lib}
154 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libauparse.so.*.*.*) \
155 $RPM_BUILD_ROOT%{_libdir}/libauparse.so
157 # We manually install this since Makefile doesn't
158 install -d $RPM_BUILD_ROOT%{_includedir}
159 install lib/libaudit.h $RPM_BUILD_ROOT%{_includedir}
161 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/auditd
162 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/auditd
165 if [ "%{py_sitedir}" != "/usr/lib/python2.4/site-packages" ]; then
166 install -d $RPM_BUILD_ROOT%{py_sitedir}
167 mv $RPM_BUILD_ROOT/usr/lib/python2.4/site-packages/* $RPM_BUILD_ROOT%{py_sitedir}
169 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
170 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
171 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
172 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
173 rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/*.py
174 rm -f $RPM_BUILD_ROOT%{py_sitedir}/*.py
175 rm -f $RPM_BUILD_ROOT%{py_sitedir}/*.{la,a}
177 rm -r $RPM_BUILD_ROOT/usr/lib/python2.4
181 rm -rf $RPM_BUILD_ROOT
183 %post libs -p /sbin/ldconfig
184 %postun libs -p /sbin/ldconfig
187 /sbin/chkconfig --add auditd
188 %service auditd restart "audit daemon"
191 if [ "$1" = "0" ]; then
193 /sbin/chkconfig --del auditd
197 %defattr(644,root,root,755)
198 %doc AUTHORS ChangeLog README THANKS TODO sample.rules
199 %attr(750,root,root) %{_sbindir}/auditctl
200 %attr(750,root,root) %{_sbindir}/auditd
201 %attr(750,root,root) %{_sbindir}/aureport
202 %attr(750,root,root) %{_sbindir}/ausearch
203 %attr(750,root,root) %{_sbindir}/autrace
204 %attr(754,root,root) /etc/rc.d/init.d/auditd
205 %dir %{_sysconfdir}/audit
206 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/auditd.conf
207 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/audit.rules
208 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/auditd
209 %attr(750,root,root) %dir %{_var}/log/audit
213 %defattr(644,root,root,755)
214 %attr(755,root,root) /%{_lib}/libaudit.so.*.*.*
215 %attr(755,root,root) /%{_lib}/libauparse.so.*.*.*
216 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libaudit.conf
219 %defattr(644,root,root,755)
220 %attr(755,root,root) %{_libdir}/libaudit.so
221 %attr(755,root,root) %{_libdir}/libauparse.so
222 %{_libdir}/libaudit.la
223 %{_libdir}/libauparse.la
224 %{_includedir}/libaudit.h
228 %defattr(644,root,root,755)
229 %{_libdir}/libaudit.a
230 %{_libdir}/libauparse.a
233 %files -n python-audit
234 %defattr(644,root,root,755)
235 %attr(750,root,root) %{_sbindir}/audispd
236 %attr(755,root,root) %{py_sitedir}/_audit.so
237 %{py_sitescriptdir}/audit.py[co]
238 %{py_sitedir}/AuditMsg.py[co]