]> git.pld-linux.org Git - packages/audit.git/blob - audit.spec
47fa4ef5f3200b906e2b86d52a28f5c6a3767adc
[packages/audit.git] / audit.spec
1 #
2 # Conditional build:
3 %bcond_without  pie     # auditd as PIE binary
4 %bcond_without  python  # don't build python bindings
5 #
6 Summary:        User space tools for 2.6 kernel auditing
7 Summary(pl):    Narzêdzia przestrzeni u¿ytkownika do audytu j±der 2.6
8 Name:           audit
9 Version:        1.2.6
10 Release:        1
11 License:        GPL
12 Group:          Daemons
13 Source0:        http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz
14 # Source0-md5:  de377351b79b813636b56bce42b0031f
15 # formerly http://people.redhat.com/sgrubb/audit/audit.h
16 Source1:        %{name}.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
29 %if %{with python}
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  swig-python
32 %else
33 BuildRequires:  sed >= 4.0
34 %endif
35 BuildRequires:  rpmbuild(macros) >= 1.268
36 Requires(post,preun):   /sbin/chkconfig
37 Requires:       %{name}-libs = %{version}-%{release}
38 Requires:       rc-scripts
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
48 %description -l pl
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.
52
53 %package libs
54 Summary:        Dynamic audit libraries
55 Summary(pl):    Biblioteki dynamiczne audit
56 License:        LGPL
57 Group:          Libraries
58
59 %description libs
60 The audit-libs package contains the dynamic libraries needed for
61 applications to use the audit framework.
62
63 %description libs -l pl
64 Ten pakiet zawiera biblioteki dynamiczne potrzebne dla aplikacji
65 u¿ywaj±cych ¶rodowiska audytu.
66
67 %package libs-devel
68 Summary:        Header files for audit libraries
69 Summary(pl):    Pliki nag³ówkowe bibliotek audit
70 License:        LGPL
71 Group:          Development/Libraries
72 Requires:       %{name}-libs = %{version}-%{release}
73 Requires:       linux-libc-headers >= 7:2.6.12.0-4
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
79 %description libs-devel -l pl
80 Ten pakiet zawiera pliki nag³ówkowe potrzebne do tworzenia aplikacji
81 u¿ywaj±cych biblioteki ¶rodowiska audytu.
82
83 %package libs-static
84 Summary:        Static audit libraries
85 Summary(pl):    Statyczne biblioteki audit
86 License:        LGPL
87 Group:          Development/Libraries
88 Requires:       %{name}-libs-devel = %{version}-%{release}
89
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.
93
94 %description libs-static -l pl
95 Ten pakiet zawiera statyczne biblioteki do tworzenia aplikacji
96 u¿ywaj±cych ¶rodowiska audytu.
97
98 %package -n python-audit
99 Summary:        Python interface to libaudit library
100 Summary(pl):    Pythonowy interfejs do biblioteki libaudit
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
108 %description -n python-audit -l pl
109 Pythonowy interfejs do biblioteki libaudit.
110
111 %prep
112 %setup -q
113 %patch0 -p1
114 %patch1 -p1
115
116 install -D %{SOURCE1} lib/linux/audit.h
117 install -D %{SOURCE1} src/mt/linux/audit.h
118
119 %if %{without python}
120 sed '/PYTHON/d; s#swig/Makefile ##' -i configure.ac
121 sed 's/swig//' -i Makefile.am
122 %endif
123
124 %build
125 %{__libtoolize}
126 %{__aclocal}
127 %{__autoconf}
128 %{__autoheader}
129 %{__automake}
130 %configure
131 # override auditd_{C,LD}FLAGS to avoid -fPIE unsupported by gcc 3.3
132 %{__make} \
133         %{!?with_pie:auditd_CFLAGS="-D_REENTRANT -D_GNU_SOURCE" auditd_LDFLAGS="-Wl,-z,relro"}
134
135 %install
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT%{_var}/log/audit
138
139 %{__make} install \
140         DESTDIR=$RPM_BUILD_ROOT
141
142 install -d $RPM_BUILD_ROOT/%{_lib}
143 mv -f $RPM_BUILD_ROOT%{_libdir}/libaudit.so.* $RPM_BUILD_ROOT/%{_lib}
144 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libaudit.so.*.*.*) \
145         $RPM_BUILD_ROOT%{_libdir}/libaudit.so
146 mv -f $RPM_BUILD_ROOT%{_libdir}/libauparse.so.* $RPM_BUILD_ROOT/%{_lib}
147 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libauparse.so.*.*.*) \
148         $RPM_BUILD_ROOT%{_libdir}/libauparse.so
149
150 # We manually install this since Makefile doesn't
151 install -d $RPM_BUILD_ROOT%{_includedir}
152 install lib/libaudit.h $RPM_BUILD_ROOT%{_includedir}
153
154 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/auditd
155 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/auditd
156
157 %if %{with python}
158 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
159 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
160 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
161 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
162 rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/*.py
163 rm -f $RPM_BUILD_ROOT%{py_sitedir}/*.py
164 rm -f $RPM_BUILD_ROOT%{py_sitedir}/*.{la,a}
165 %endif
166
167 %clean
168 rm -rf $RPM_BUILD_ROOT
169
170 %post   libs -p /sbin/ldconfig
171 %postun libs -p /sbin/ldconfig
172
173 %post
174 /sbin/chkconfig --add auditd
175 %service auditd restart "audit daemon"
176
177 %preun
178 if [ "$1" = "0" ]; then
179         %service auditd stop
180         /sbin/chkconfig --del auditd
181 fi
182
183 %files
184 %defattr(644,root,root,755)
185 %doc AUTHORS ChangeLog README THANKS TODO sample.rules
186 %attr(750,root,root) %{_sbindir}/audispd
187 %attr(750,root,root) %{_sbindir}/auditctl
188 %attr(750,root,root) %{_sbindir}/auditd
189 %attr(750,root,root) %{_sbindir}/aureport
190 %attr(750,root,root) %{_sbindir}/ausearch
191 %attr(750,root,root) %{_sbindir}/autrace
192 %attr(754,root,root) /etc/rc.d/init.d/auditd
193 %dir %{_sysconfdir}/audit
194 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/auditd.conf
195 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/audit/audit.rules
196 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/auditd
197 %attr(750,root,root) %dir %{_var}/log/audit
198 %{_mandir}/man8/*
199
200 %files libs
201 %defattr(644,root,root,755)
202 %attr(755,root,root) /%{_lib}/libaudit.so.*.*.*
203 %attr(755,root,root) /%{_lib}/libauparse.so.*.*.*
204 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libaudit.conf
205
206 %files libs-devel
207 %defattr(644,root,root,755)
208 %attr(755,root,root) %{_libdir}/libaudit.so
209 %attr(755,root,root) %{_libdir}/libauparse.so
210 %{_libdir}/libaudit.la
211 %{_libdir}/libauparse.la
212 %{_includedir}/libaudit.h
213 %{_mandir}/man3/*
214
215 %files libs-static
216 %defattr(644,root,root,755)
217 %{_libdir}/libaudit.a
218 %{_libdir}/libauparse.a
219
220 %if %{with python}
221 %files -n python-audit
222 %defattr(644,root,root,755)
223 %attr(755,root,root) %{py_sitedir}/_audit.so
224 %{py_sitescriptdir}/audit.py[co]
225 %{py_sitedir}/AuditMsg.py[co]
226 %endif
This page took 0.054034 seconds and 3 git commands to generate.