]>
Commit | Line | Data |
---|---|---|
e5a8c0d8 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without pie # auditd as PIE binary | |
57f09668 | 4 | %bcond_without python # don't build python bindings |
e5a8c0d8 | 5 | # |
54697230 | 6 | Summary: User space tools for 2.6 kernel auditing |
7f0a1e1e | 7 | Summary(pl.UTF-8): Narzędzia przestrzeni użytkownika do audytu jąder 2.6 |
54697230 | 8 | Name: audit |
6d3a6f20 JB |
9 | Version: 1.4.1 |
10 | Release: 1 | |
54697230 JB |
11 | License: GPL |
12 | Group: Daemons | |
13 | Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz | |
6d3a6f20 | 14 | # Source0-md5: bd41d7ce365758ccf695471cff7bb802 |
7630c8d3 | 15 | # formerly http://people.redhat.com/sgrubb/audit/audit.h |
96102055 | 16 | Source1: %{name}.h |
de2a21fd JB |
17 | Source2: %{name}d.init |
18 | Source3: %{name}d.sysconfig | |
eb9b3ab9 | 19 | Patch0: %{name}-swig-fix.patch |
7630c8d3 | 20 | Patch1: %{name}-install.patch |
54697230 JB |
21 | URL: http://people.redhat.com/sgrubb/audit/ |
22 | BuildRequires: autoconf >= 2.59 | |
10583781 | 23 | BuildRequires: automake >= 1:1.9 |
e5a8c0d8 | 24 | %{?with_pie:BuildRequires: gcc >= 5:3.4} |
10583781 JB |
25 | BuildRequires: glibc-headers >= 6:2.3.6 |
26 | BuildRequires: libstdc++-devel | |
54697230 JB |
27 | BuildRequires: libtool |
28 | BuildRequires: linux-libc-headers >= 2.6.11 | |
57f09668 | 29 | %if %{with python} |
9ee6c1ce | 30 | BuildRequires: rpm-pythonprov |
7e695d35 | 31 | BuildRequires: swig-python |
57f09668 | 32 | %else |
33 | BuildRequires: sed >= 4.0 | |
34 | %endif | |
35 | BuildRequires: rpmbuild(macros) >= 1.268 | |
54697230 JB |
36 | Requires(post,preun): /sbin/chkconfig |
37 | Requires: %{name}-libs = %{version}-%{release} | |
96102055 | 38 | Requires: rc-scripts |
54697230 JB |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
40 | ||
41 | %define _sbindir /sbin | |
42 | ||
43 | %description | |
44 | The audit package contains the user space utilities for storing and | |
45 | processing the audit records generate by the audit subsystem in the | |
46 | Linux 2.6 kernel. | |
47 | ||
b27e8f95 JR |
48 | %description -l pl.UTF-8 |
49 | Ten pakiet zawiera narzędzia przestrzeni użytkownika do przechowywania | |
50 | i przetwarzania rekordów audytu generowanych przez podsystem audytu w | |
51 | jądrach Linuksa 2.6. | |
54697230 JB |
52 | |
53 | %package libs | |
5a56b716 | 54 | Summary: Dynamic audit libraries |
7f0a1e1e | 55 | Summary(pl.UTF-8): Biblioteki dynamiczne audit |
54697230 JB |
56 | License: LGPL |
57 | Group: Libraries | |
58 | ||
59 | %description libs | |
5a56b716 | 60 | The audit-libs package contains the dynamic libraries needed for |
54697230 JB |
61 | applications to use the audit framework. |
62 | ||
b27e8f95 | 63 | %description libs -l pl.UTF-8 |
5a56b716 | 64 | Ten pakiet zawiera biblioteki dynamiczne potrzebne dla aplikacji |
b27e8f95 | 65 | używających środowiska audytu. |
54697230 JB |
66 | |
67 | %package libs-devel | |
5a56b716 | 68 | Summary: Header files for audit libraries |
7f0a1e1e | 69 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek audit |
54697230 JB |
70 | License: LGPL |
71 | Group: Development/Libraries | |
72 | Requires: %{name}-libs = %{version}-%{release} | |
de2a21fd | 73 | Requires: linux-libc-headers >= 7:2.6.12.0-4 |
54697230 JB |
74 | |
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. | |
78 | ||
b27e8f95 JR |
79 | %description libs-devel -l pl.UTF-8 |
80 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia aplikacji | |
81 | używających biblioteki środowiska audytu. | |
54697230 JB |
82 | |
83 | %package libs-static | |
5a56b716 | 84 | Summary: Static audit libraries |
7f0a1e1e | 85 | Summary(pl.UTF-8): Statyczne biblioteki audit |
54697230 JB |
86 | License: LGPL |
87 | Group: Development/Libraries | |
88 | Requires: %{name}-libs-devel = %{version}-%{release} | |
89 | ||
90 | %description libs-static | |
5a56b716 JB |
91 | The audit-libs-static package contains the static libraries for |
92 | developing applications that need to use the audit framework. | |
54697230 | 93 | |
b27e8f95 | 94 | %description libs-static -l pl.UTF-8 |
5a56b716 | 95 | Ten pakiet zawiera statyczne biblioteki do tworzenia aplikacji |
b27e8f95 | 96 | używających środowiska audytu. |
54697230 | 97 | |
9ee6c1ce JB |
98 | %package -n python-audit |
99 | Summary: Python interface to libaudit library | |
7f0a1e1e | 100 | Summary(pl.UTF-8): Pythonowy interfejs do biblioteki libaudit |
9ee6c1ce JB |
101 | License: LGPL |
102 | Group: Libraries/Python | |
103 | Requires: %{name}-libs = %{version}-%{release} | |
104 | ||
105 | %description -n python-audit | |
106 | Python interface to libaudit library. | |
107 | ||
b27e8f95 | 108 | %description -n python-audit -l pl.UTF-8 |
9ee6c1ce JB |
109 | Pythonowy interfejs do biblioteki libaudit. |
110 | ||
54697230 JB |
111 | %prep |
112 | %setup -q | |
eb9b3ab9 | 113 | %patch0 -p1 |
7630c8d3 | 114 | %patch1 -p1 |
54697230 | 115 | |
1a8b063a JB |
116 | install -D %{SOURCE1} lib/linux/audit.h |
117 | install -D %{SOURCE1} src/mt/linux/audit.h | |
118 | ||
3d5ad897 | 119 | %if !%{with python} |
2a3ea293 | 120 | sed '/PYTHON/d; s#swig/Makefile ##; s# audisp/Makefile##' -i configure.ac |
121 | sed 's/swig//; s/audisp//' -i Makefile.am | |
57f09668 | 122 | %endif |
123 | ||
54697230 JB |
124 | %build |
125 | %{__libtoolize} | |
126 | %{__aclocal} | |
127 | %{__autoconf} | |
128 | %{__autoheader} | |
129 | %{__automake} | |
cc094a3e AM |
130 | %configure \ |
131 | --with-apparmor | |
e5a8c0d8 JB |
132 | # override auditd_{C,LD}FLAGS to avoid -fPIE unsupported by gcc 3.3 |
133 | %{__make} \ | |
aac5fae1 | 134 | %{!?with_pie:auditd_CFLAGS="-D_REENTRANT -D_GNU_SOURCE" auditd_LDFLAGS="-Wl,-z,relro"} |
54697230 | 135 | |
bf2e6acc JB |
136 | # temporarily not included in all |
137 | %{__make} -C auparse | |
138 | ||
54697230 JB |
139 | %install |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | install -d $RPM_BUILD_ROOT%{_var}/log/audit | |
142 | ||
143 | %{__make} install \ | |
144 | DESTDIR=$RPM_BUILD_ROOT | |
145 | ||
bf2e6acc JB |
146 | # temporarily not included in all |
147 | %{__make} -C auparse install \ | |
148 | DESTDIR=$RPM_BUILD_ROOT | |
149 | ||
54697230 JB |
150 | install -d $RPM_BUILD_ROOT/%{_lib} |
151 | mv -f $RPM_BUILD_ROOT%{_libdir}/libaudit.so.* $RPM_BUILD_ROOT/%{_lib} | |
de2a21fd | 152 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libaudit.so.*.*.*) \ |
1a8b063a | 153 | $RPM_BUILD_ROOT%{_libdir}/libaudit.so |
8ba70267 JB |
154 | mv -f $RPM_BUILD_ROOT%{_libdir}/libauparse.so.* $RPM_BUILD_ROOT/%{_lib} |
155 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libauparse.so.*.*.*) \ | |
156 | $RPM_BUILD_ROOT%{_libdir}/libauparse.so | |
54697230 JB |
157 | |
158 | # We manually install this since Makefile doesn't | |
159 | install -d $RPM_BUILD_ROOT%{_includedir} | |
160 | install lib/libaudit.h $RPM_BUILD_ROOT%{_includedir} | |
161 | ||
de2a21fd JB |
162 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/auditd |
163 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/auditd | |
164 | ||
57f09668 | 165 | %if %{with python} |
eb9b3ab9 | 166 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} |
8e99bb72 | 167 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
eb9b3ab9 | 168 | rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/*.py |
8e99bb72 | 169 | rm -f $RPM_BUILD_ROOT%{py_sitedir}/*.{la,a} |
57f09668 | 170 | %endif |
9ee6c1ce | 171 | |
54697230 JB |
172 | %clean |
173 | rm -rf $RPM_BUILD_ROOT | |
174 | ||
175 | %post libs -p /sbin/ldconfig | |
176 | %postun libs -p /sbin/ldconfig | |
177 | ||
178 | %post | |
179 | /sbin/chkconfig --add auditd | |
2a6b8c9c | 180 | %service auditd restart "audit daemon" |
54697230 JB |
181 | |
182 | %preun | |
183 | if [ "$1" = "0" ]; then | |
2a6b8c9c | 184 | %service auditd stop |
54697230 JB |
185 | /sbin/chkconfig --del auditd |
186 | fi | |
187 | ||
188 | %files | |
189 | %defattr(644,root,root,755) | |
190 | %doc AUTHORS ChangeLog README THANKS TODO sample.rules | |
191 | %attr(750,root,root) %{_sbindir}/auditctl | |
192 | %attr(750,root,root) %{_sbindir}/auditd | |
e5a8c0d8 | 193 | %attr(750,root,root) %{_sbindir}/aureport |
54697230 JB |
194 | %attr(750,root,root) %{_sbindir}/ausearch |
195 | %attr(750,root,root) %{_sbindir}/autrace | |
196 | %attr(754,root,root) /etc/rc.d/init.d/auditd | |
7630c8d3 JB |
197 | %dir %{_sysconfdir}/audit |
198 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/auditd.conf | |
199 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/audit.rules | |
f6ae0a53 | 200 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/auditd |
54697230 JB |
201 | %attr(750,root,root) %dir %{_var}/log/audit |
202 | %{_mandir}/man8/* | |
203 | ||
204 | %files libs | |
205 | %defattr(644,root,root,755) | |
206 | %attr(755,root,root) /%{_lib}/libaudit.so.*.*.* | |
8ba70267 | 207 | %attr(755,root,root) /%{_lib}/libauparse.so.*.*.* |
7630c8d3 | 208 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libaudit.conf |
54697230 JB |
209 | |
210 | %files libs-devel | |
211 | %defattr(644,root,root,755) | |
212 | %attr(755,root,root) %{_libdir}/libaudit.so | |
8ba70267 | 213 | %attr(755,root,root) %{_libdir}/libauparse.so |
54697230 | 214 | %{_libdir}/libaudit.la |
8ba70267 | 215 | %{_libdir}/libauparse.la |
6d3a6f20 | 216 | %{_includedir}/auparse*.h |
54697230 JB |
217 | %{_includedir}/libaudit.h |
218 | %{_mandir}/man3/* | |
219 | ||
220 | %files libs-static | |
221 | %defattr(644,root,root,755) | |
222 | %{_libdir}/libaudit.a | |
8ba70267 | 223 | %{_libdir}/libauparse.a |
9ee6c1ce | 224 | |
57f09668 | 225 | %if %{with python} |
9ee6c1ce JB |
226 | %files -n python-audit |
227 | %defattr(644,root,root,755) | |
d1469141 | 228 | %attr(750,root,root) %{_sbindir}/audispd |
9ee6c1ce | 229 | %attr(755,root,root) %{py_sitedir}/_audit.so |
6d3a6f20 | 230 | %attr(755,root,root) %{py_sitedir}/_auparse.so |
8e99bb72 | 231 | %{py_sitescriptdir}/audit.py[co] |
6d3a6f20 JB |
232 | %{py_sitescriptdir}/auparse.py[co] |
233 | %{py_sitescriptdir}/AuditMsg.py[co] | |
57f09668 | 234 | %endif |