File dazuko.spec of Package dazuko

#
# spec file for package dazuko (Version 2.3.6)
#
# Copyright (c) 2009 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/
#

# norootforbuild
# nodebuginfo

Url:            http://www.dazuko.org/

Name:           dazuko
License:        BSD 3-Clause; GPL v2 or later; LGPL v2.1 or later
Group:          System/Kernel
Version:        2.3.6
Release:        1.<RELEASE49>
%define dazuko_version 2.3.6-pre2
%define redirfs_version 0.3
Summary:        On-access Virus Scanning Kernel Interface
Source0:        dazuko-%{version}.bz2
Source1:        dazuko.sysconfig
Source2:        dazuko.init-script
Patch0:         dazuko_redirfs_2.6.27.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64
#Obsoletes:    km_antivir km_dazuko
Requires:       dazuko-kmp
BuildRequires:  kernel-source kernel-syms module-init-tools
%suse_kernel_module_package kdump um

%description
The dazuko package contains the boot script for loading/unloading the
dazuko on-access virus scanning kernel interface module provided by the
dazuko-KMP kernel module packages.



Authors:
--------
    John Ogness
    Martin Ritter

%package KMP
License:        BSD 3-Clause; GPL v2 or later
Summary:        On-access Virus Scanning Kernel Interface
Group:          System/Kernel

%description KMP
The dazuko-KMP package contains the dazuko on-access virus scanning
kernel interface module and the redirfs kernel interface module.



Authors:
--------
    John Ogness
    Martin Ritter

%prep
%setup
tar xvzf dazuko-%{dazuko_version}.tar.gz
mv dazuko-%{dazuko_version} dazuko
tar xvzf redirfs-%{redirfs_version}.tar.gz
mv redirfs-%{redirfs_version} redirfs
pushd dazuko
%patch -p1
popd
set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
for flavor in %flavors_to_build; do
	rm -rf obj/$flavor
	cp -r source obj/$flavor
	pushd obj/$flavor/dazuko
	KERNEL_SRC="/usr/src/linux"
	KERNEL_OBJ="/usr/src/linux-obj/%_target_cpu/$flavor"
	DEBUG_FLAGS=""
	case $flavor in
		*debug*) DEBUG_FLAGS="--enable-debug" ;;
	esac
	CONFIGURE_FLAGS="--enable-redirfs --redirfsdir=`pwd`/../redirfs"
	./configure \
		--kernelsrcdir=${KERNEL_SRC} \
		--kernelobjdir=${KERNEL_OBJ} \
		${CONFIGURE_FLAGS} ${DEBUG_FLAGS}
	popd
	make -C ${KERNEL_OBJ} modules M=$PWD/obj/$flavor
done

%install
rm -rf %buildroot
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
###
for flavor in %flavors_to_build; do
	make -C /usr/src/linux-obj/%_target_cpu/$flavor \
		modules_install M=$PWD/obj/$flavor
done
###
install -m755 -d $RPM_BUILD_ROOT/etc/init.d
install -m755 -d $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m754    $RPM_SOURCE_DIR/dazuko.init-script \
                 $RPM_BUILD_ROOT/etc/init.d/boot.dazuko
install -m644    $RPM_SOURCE_DIR/dazuko.sysconfig \
                 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.dazuko

%post
%{fillup_and_insserv -i -n dazuko}

%preun
%if %suse_version > 820
%{stop_on_removal boot.dazuko}
%endif

%postun
#%if %suse_version > 820
#%{restart_on_update boot.dazuko}
#%endif
%insserv_cleanup

%files
%defattr(-,root,root)
/etc/init.d/boot.dazuko
/var/adm/fillup-templates/sysconfig.dazuko

%changelog
* Wed Sep 10 2008 andavis@novell.com
- Updated redirfs-0.3-pre4 to redirfs-0.3
- Replaced 2.6.27 dazuko patch with proposed dazuko_redirfs_2.6.27
  patch from www.redirfs.org
* Mon Aug 25 2008 andavis@novell.com
- Patches to address 2.6.27 device and inode API changes
* Wed Aug 20 2008 andavis@novell.com
- Patch to use linux/semaphore.h instead of asm/semaphore.h
* Thu Aug 14 2008 andavis@novell.com
- Update to dazuko-2.3.6-pre2 and redirfs-0.3-pre4
* Wed Aug 13 2008 andavis@novell.com
- Add stop directives to init script
* Tue Jul 29 2008 andavis@novell.com
- Restructure to build both dazuko and redirfs from toplevel
  Kbuild file
* Thu Jul 24 2008 andavis@novell.com
- Update to redirfs 0.3-pre3
* Mon Jul 21 2008 andavis@novell.com
- Preliminary update to dazuko 2.3.6-pre1 and redirfs 0.3-pre2
  in order to build on 2.6.26.
* Wed Mar 12 2008 ro@suse.de
- hack to build on 2.6.25-rc5
* Tue Jan 15 2008 mt@suse.de
- Updated to dazuko cvs head 2008011501 using redirfs instead of
  the LSM kernel interface, because 2.6.24rc kernel versions do
  not support LSM kernel modules any more (bug #352003).
- The redirfs modules are shipped inside of dazuko kmp packages
  at the moment.
* Fri Oct 19 2007 ro@suse.de
- update to 2.3.4
  - remove error checking for device unregistration (Linux 2.6+syscall/RSBAC)
  - added "--procs-per-group" option for maximum allowed registered processes
  - use -fPIC when compiling DazukoIO library
  - check if a dazuko module already exists when running "make install"
  - update perl binding (fix for 64-bit systems)
  - add support for Linux 2.6.21 (SUSE) LSM API
  - added support for Linux 2.6.23-rc4 LSM API (patch #13828)
  - added "--sct-nocheck" option to disable syscall table checks
  - removed __d_path(), root, rootmnt dependencies for Linux 2.6 (LSM)
  - added support for Linux 2.6.23-rc3 LSM API (patch #13661)
  - minor code readability improvements (patch #13783)
* Wed Apr 04 2007 mt@suse.de
- Adopted for new LSM prototypes in kernel 2.6.21_rc5_git8_2.
  New patch file: dazuko-2.3.3.dif
- Added module-init-tools to build requires.
* Fri Mar 23 2007 mt@suse.de
- Updated to dazuko-2.3.3(.4) final, including 2.6.21 LSM patch.
  Obsolete patch file: dazuko-2.3.3-pre3_linux-2.6.21.dif
* Wed Mar 21 2007 mt@suse.de
- Updated to dazuko-2.3.3-pre3 including support for linux-2.6.20
  LSM obsoleting dazuko-2.3.2-linux-2.6.19plus.dif patch file
  as well as several other fixes and improvements, e.g.:
  * include new Lua binding
  * resolved namespace issue with "struct path"
  * add official support for suspend2 on Linux 2.6
  * cleanup thread handling for TAF on Linux 2.6
  * fix DazukoIO X/Y-bit compatibility for trusted processes
  * remove unnecessary global variables from DazukoIO
  * restructured DazukoIO protocol fallback code
- Adopted to LSM interface (getprocattr) for linux-2.6.21 LSM
  New patch file: dazuko-2.3.3-pre3_linux-2.6.21.dif
* Mon Jan 15 2007 mt@suse.de
- Merged changes from dazuko cvs to compile with Linux >= 2.6.19
  New patch file: dazuko-2.3.2-linux-2.6.19plus.dif
* Fri Dec 01 2006 mt@suse.de
- Updated to dazuko-2.3.2, providing following fixes [Bug #224985]:
  * name-cache leak for Linux 2.2, 2.4, and 2.6+syscall (patch #5552)
  * memory leak when removing trusted applications (patch #5552)
  * Linux 2.6 LSM stacking as a secondary module (obsoletes our
  dazuko-second_register.diff patch)
  * overly conservative snprintf() calls
* Thu Nov 16 2006 mt@suse.de
- Renamed package from hbedv-dazuko(-KMP) to dazuko(-KMP).
* Wed Nov 08 2006 mt@suse.de
- Improved LSB required-start tag in boot.dazuko init script.
* Mon Nov 06 2006 mt@suse.de
- Updated to dazuko-2.3.1 making our configure patch obsolete.
- Added dazuko-second_register.diff patch fixing init of the
  inode permission hook while registering as secondary LSM.
- Added boot.dazuko init script loading the dazuko module.
* Tue Aug 29 2006 mt@suse.de
- Updated to dazuko-2.3.1pre2 supporting sys_call hooking on
  linux26, required to work togeter with apparmor (unused).
* Mon Apr 10 2006 ro@suse.de
- added nodebuginfo tag to specfile
* Tue Feb 07 2006 mt@suse.de
- Added patch adding invoking of the inode permission lsm hook
  of a secondary module. See Bug #65751.
* Mon Jan 23 2006 mt@suse.de
- Initial package replacing km_dazuko.