File audit.spec of Package audit

#
# spec file for package audit
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           audit
Summary:        First part of auditing package
License:        GPL-2.0+
Group:          System/Monitoring
Version:        2.2.3
Release:        0
Url:            http://people.redhat.com/sgrubb/audit/
Source0:        http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz
Source2:        auditd.sysconfig
Source3:        baselibs.conf
Source4:        README-BEFORE-ADDING-PATCHES
Patch1:         audit-no_m4_dir.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf >= 2.12
BuildRequires:  gcc-c++
BuildRequires:  kernel-headers >= 2.6.30
BuildRequires:  libtool
BuildRequires:  tcpd-devel
Requires:       %{name}-libs = %{version}
PreReq:         %insserv_prereq %fillup_prereq

%description
The audit package contains the user space utilities for storing and
processing the audit records generated by the audit subsystem in the
Linux 2.6 kernel.

%package -n libaudit1
Summary:        Dynamic library for libaudit
License:        LGPL-2.1+
Group:          System/Monitoring
Obsoletes:      %{name}-libs < 2.0.4
Provides:       %{name}-libs = %{version}

%description -n libaudit1
The libaudit package contains the dynamic libraries needed for
applications to use the audit framework.

%package -n libauparse0
Summary:        Dynamic library for libauparse
License:        LGPL-2.1+
Group:          System/Monitoring

%description -n libauparse0
The libauparse package contains the dynamic libraries needed to 
parse audit records.

%package -n audit-devel
Summary:        Header files and static library for libaudit
License:        LGPL-2.1+
Group:          Development/Libraries/C and C++
Requires:       libaudit1 = %{version}
Requires:       libauparse0 = %{version}

%description -n audit-devel
The audit-devel package contains the static libraries and header files
needed for developing applications that need to use the audit framework
libraries.

%prep
%setup -q -n %{name}-%{version}
%patch1 -p1

%build
autoreconf -fi
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-Wl,-z,relro,-z,now"
# no krb support (omit --enable-gssapi-krb5=yes), see audit-no-gss.patch
%configure --enable-systemd --libexecdir=%{_prefix}/lib/%{name} \
	   --with-apparmor --with-libwrap --without-libcap-ng \
	   --disable-static --with-pic --without-python
(cd lib ; %{__make} %{?_smp_mflags})
(cd auparse ; %{__make} %{?_smp_mflags})
(cd docs ; %{__make} %{?_smp_mflags})

%install
(cd lib ; make DESTDIR=$RPM_BUILD_ROOT install)
(cd auparse ; make DESTDIR=$RPM_BUILD_ROOT install)
(cd docs ; make DESTDIR=$RPM_BUILD_ROOT install)
rm -rf $RPM_BUILD_ROOT/%{_mandir}/man[578]
mkdir -p $RPM_BUILD_ROOT/etc
mkdir -p $RPM_BUILD_ROOT/%{_includedir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man5
# We manually install this since Makefile doesn't
install -m 0644 lib/libaudit.h $RPM_BUILD_ROOT/%{_includedir}
# Install libaudit.conf files by hand
install -m 0644 docs/libaudit.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5
install -m 0644 init.d/libaudit.conf $RPM_BUILD_ROOT/etc

%{__rm} -fv %{buildroot}/%{_libdir}/lib{audit,auparse}.la

%check
(cd lib ; make check)
(cd auparse ; make check)

%post -n libaudit1 -p /sbin/ldconfig

%post -n libauparse0 -p /sbin/ldconfig

%postun -n libaudit1 -p /sbin/ldconfig

%postun -n libauparse0 -p /sbin/ldconfig

%files -n libaudit1
%defattr(-,root,root)
%{_libdir}/libaudit.so.*
%config(noreplace) %attr(640,root,root) /etc/libaudit.conf
%{_mandir}/man5/libaudit.conf.5.gz

%files -n libauparse0
%defattr(-,root,root)
%{_libdir}/libauparse.so.*

%files -n audit-devel
%defattr(-,root,root)
%doc contrib/skeleton.c contrib/plugin
%{_libdir}/libaudit.so
%{_libdir}/libauparse.so
%{_includedir}/libaudit.h
%{_includedir}/auparse.h
%{_includedir}/auparse-defs.h
%{_mandir}/man3/*

%changelog
openSUSE Build Service is sponsored by