File samhain.spec of Package samhain

#
# Accepted parameters for 'rpmbuild':
#
# --with tests		- make tests before building

Summary:	File integrity and host-based IDS
Name:		samhain
Version:	3.0.6
Release:	1
License:	GPL
Group:		System/Monitoring
URL:		http://www.la-samhna.de/samhain/
Source:		samhain-%{version}.tar.gz
Source1:	yule.init
Patch0:		Makefile_in.patch
BuildRequires:	procps
BuildRequires:	pcre-devel
BuildRequires:	zlib-devel
Requires:	procps 
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

# dummy (fix configure warning)
# datarootdir = @datarootdir@

# no quotes here - aparently will be expanded literally

%define withpwd_prg xDSH_WITH_CLIENT
%define withstg_prg x

# disable automatic stripping of binaries upon installation
%define __spec_install_post %{nil}
# required because DeadRat wants to package some debug info otherwise
# (this debug info would be created by debug_install_post called
# from spec_install_post)
%define debug_package %{nil}
# Use internal dependency generator rather than external helpers?
%define _use_internal_dependency_generator     0

%description
samhain is an open source file integrity and host-based intrusion
detection system for Linux and Unix. It can run as a daemon process, and
and thus can remember file changes -- contrary to a tool that runs from
cron, if a file is modified you will get only one report, while
subsequent checks of that file will ignore the modification as it is
already reported (unless the file is modified again). 

samhain can optionally be used as client/server system to provide
centralized monitoring for multiple host. Logging to a (MySQL or
PostgreSQL) database is supported.

NOTE: for security reasons, if you distribute binary executables to
third parties you should point out the use of the --add-key option to
modify the key material within the executable.
This spec file is intended to facilitate installation on YOUR system.
If you use this spec file to build a SRPM for distribution to third parties,
make sure to remove the --enable-base configure option below.

%prep
%setup -q -n samhain-%{version}
%patch0

%build
%if %{?_with_tests:1}%{!?_with_tests:0}
# test installation (test #7 is only included if --with gpg has been
# specified)
for i in `seq 6` %{?_with_gpg:7}; do ./test/test.sh $i; done
%endif
#
# configure with the user-supplied arguments to './configure'
#
./configure \
	--sbindir=%{_sbindir} \
	--mandir=%{_mandir} \
	--enable-base=1616584945,277757850 \
	--enable-network=client \
	--enable-micro-stealth=168 \
	--enable-suidcheck \
	--enable-login-watch \
	--enable-mounts-check \
	--enable-logfile-monitor \
	--enable-process-check \
	--enable-port-check \
	--enable-userfiles \
	--enable-xml-log \
	--with-config-file=REQ_FROM_SERVER/%{_sysconfdir}/%{name}rc \
	--with-data-file=REQ_FROM_SERVER/%{_localstatedir}/lib/%{name}/%{name}_file 

make %{?_smp_mflags}

%install
rm -rf %{buildroot}

# sstrip shouldn't be used since binaries will be stripped later
## cat << EOF > sstrip
## #!/bin/sh
## echo "*** SSTRIP DISABLED ***"
## EOF

make %{?_smp_mflags} DESTDIR=${RPM_BUILD_ROOT} install

mkdir -p %{buildroot}%{_initrddir}
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_datarootdir}/%{name}

# init script
install -m 0755 %{S:1} %{buildroot}/%{_initrddir}/%{name}
sed -i 's/yule/%{name}/' %{buildroot}/%{_initrddir}/%{name}
ln -s %{_initrddir}/%{name} %{buildroot}/%{_sbindir}/rc%{name}

%clean
rm -rf %{buildroot}

%post
if test "x" = x; then
   :
else
   if test -f /sbin/depmod; then
     /sbin/depmod -a
   fi
fi

%preun
%stop_on_removal

%postun
%restart_on_update
%insserv_cleanup

%files
%defattr(-,root,root)
%doc docs/BUGS COPYING docs/Changelog docs/TODO
%doc LICENSE docs/FAQ.html docs/HOWTO* docs/MANUAL-2_3.* docs/README*
%{_localstatedir}/lib/%{name}
%{_sbindir}/%{name}
%if "%{withstg_prg}" == "xsamhain_stealth"
        %{_sbindir}/%{name}_stealth
%endif
%if "%{withpwd_prg}" == "xDSH_WITH_CLIENT"
        %{_sbindir}/%{name}_setpwd
%endif
%if "%{withpwd_prg}" == "xDSH_WITH_SERVER"
        %{_sbindir}/%{name}ctl
        %exclude %{_sbindir}/%{name}_setpwd
%endif
%attr(644,root,root) %{_mandir}/man5/samhain*
%attr(644,root,root) %{_mandir}/man8/samhain*
%attr(600,root,root) %config(noreplace) %{_sysconfdir}/%{name}rc
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_initrddir}/%{name}
%{_sbindir}/rc%{name}


%changelog
openSUSE Build Service is sponsored by