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