+#
# Conditional build:
-%bcond_without kerberos5 # do not build with heimdal
+%bcond_without kerberos5 # Kerberos V support via heimdal
%bcond_without prelude # prelude audisp plugin
-%bcond_without python # don't build python bindings
-%bcond_without zos_remote # do not build zos-remote audisp plugin (LDAP dep)
-#
+%bcond_without golang # Go language bindings
+%bcond_without python # Python bindings (any)
+%bcond_without python3 # Python 3 bindings
+%bcond_without zos_remote # zos-remote audisp plugin (LDAP dep)
+
+%ifnarch %{ix86} %{x8664} %{arm}
+%undefine with_golang
+%endif
+
+%if %{without python}
+%undefine with_python3
+%endif
Summary: User space tools for 2.6 kernel auditing
Summary(pl.UTF-8): Narzędzia przestrzeni użytkownika do audytu jąder 2.6
Name: audit
-Version: 2.3.4
-Release: 1
+Version: 2.4.4
+Release: 5
License: GPL v2+
Group: Daemons
Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz
-# Source0-md5: ababfa3a192d6acba8806c9dcb16a6c8
+# Source0-md5: 72b0fd94d32846142bc472f0d91e62b4
Source2: %{name}d.init
Source3: %{name}d.sysconfig
Patch0: %{name}-install.patch
Patch5: %{name}-am.patch
Patch6: %{name}-no-refusemanualstop.patch
Patch7: %{name}-cronjob.patch
+Patch8: golang-paths.patch
+# https://fedorahosted.org/fesco/ticket/1311
+Patch9: never-audit.patch
URL: http://people.redhat.com/sgrubb/audit/
BuildRequires: autoconf >= 2.59
BuildRequires: automake >= 1:1.9
BuildRequires: glibc-headers >= 6:2.3.6
+%{?with_golang:BuildRequires: golang >= 1.4}
%{?with_kerberos5:BuildRequires: heimdal-devel}
BuildRequires: libcap-ng-devel
%{?with_prelude:BuildRequires: libprelude-devel}
BuildRequires: rpm-pythonprov
BuildRequires: swig-python
%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: rpm-pythonprov
+BuildRequires: swig-python
+%endif
BuildRequires: rpmbuild(macros) >= 1.623
BuildRequires: sed >= 4.0
Requires(post,preun): /sbin/chkconfig
audytowe wykorzystująca libprelude do wysyłania alarmów IDMEF o
prawdopodobnych zdarzeniach IDS.
+%package -n golang-audit
+Summary: Go language interface to libaudit library
+Summary(pl.UTF-8): Interfejs języka Go do biblioteki libaudit
+License: LGPL v2.1+
+Group: Development/Languages
+Requires: %{name}-libs = %{version}-%{release}
+Requires: golang >= 1.4
+
+%description -n golang-audit
+Go language interface to libaudit library.
+
+%description -n golang-audit -l pl.UTF-8
+Interfejs języka Go do biblioteki libaudit.
+
%package -n python-audit
-Summary: Python interface to libaudit library
-Summary(pl.UTF-8): Pythonowy interfejs do biblioteki libaudit
+Summary: Python 2.x interface to libaudit library
+Summary(pl.UTF-8): Interfejs Pythona 2.x do biblioteki libaudit
License: LGPL v2.1+
Group: Libraries/Python
Requires: %{name}-libs = %{version}-%{release}
%description -n python-audit
-Python interface to libaudit library.
+Python 2.x interface to libaudit library.
%description -n python-audit -l pl.UTF-8
-Pythonowy interfejs do biblioteki libaudit.
+Interfejs Pythona 2.x do biblioteki libaudit.
+
+%package -n python3-audit
+Summary: Python 3.x interface to libaudit library
+Summary(pl.UTF-8): Interfejs Pythona 3.x do biblioteki libaudit
+License: LGPL v2.1+
+Group: Libraries/Python
+Requires: %{name}-libs = %{version}-%{release}
+
+%description -n python3-audit
+Python 3.x interface to libaudit library.
+
+%description -n python3-audit -l pl.UTF-8
+Interfejs Pythona 3.x do biblioteki libaudit.
%prep
%setup -q
%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
+%patch9 -p1
%if %{without python}
sed 's#swig/Makefile ##' -i configure.ac
%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.{la,a}
%endif
+%if %{with python3}
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.{la,a}
+%endif
+
%clean
rm -rf $RPM_BUILD_ROOT
%{_libdir}/libauparse.la
%{_includedir}/auparse*.h
%{_includedir}/libaudit.h
+%{_pkgconfigdir}/audit.pc
+%{_pkgconfigdir}/auparse.pc
%{_mandir}/man3/audit_*.3*
%{_mandir}/man3/auparse_*.3*
%{_mandir}/man3/ausearch_*.3*
%{_mandir}/man8/audisp-prelude.8*
%endif
+%if %{with golang}
+%files -n golang-audit
+%defattr(644,root,root,755)
+%dir %{_libdir}/golang/src/redhat.com
+%{_libdir}/golang/src/redhat.com/audit
+%endif
+
%if %{with python}
%files -n python-audit
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/auparse.so
%{py_sitedir}/audit.py[co]
%endif
+
+%if %{with python3}
+%files -n python3-audit
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/_audit.so
+%attr(755,root,root) %{py3_sitedir}/auparse.so
+%{py3_sitedir}/audit.py
+%endif