OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Christoph Schug
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src openpkg-web openpkg$ Date:   05-Aug-2003 12:55:36
  Branch: HEAD                             Handle: 2003080511553402

  Added files:
    openpkg-re/vcheck       vc.sav
    openpkg-src/sav         rc.sav sav.conf wrap_open.c
  Modified files:
    openpkg-src/sav         sav.spec sweep.sh
    openpkg-web             news.txt

  Log:
    upgrading package: sav 3.56 -> 2.14

  Summary:
    Revision    Changes     Path
    1.1         +30 -0      openpkg-re/vcheck/vc.sav
    1.1         +12 -0      openpkg-src/sav/rc.sav
    1.1         +1  -0      openpkg-src/sav/sav.conf
    1.15        +85 -40     openpkg-src/sav/sav.spec
    1.2         +14 -3      openpkg-src/sav/sweep.sh
    1.1         +22 -0      openpkg-src/sav/wrap_open.c
    1.6033      +1  -0      openpkg-web/news.txt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-re/vcheck/vc.sav
  ============================================================================
  $ cvs diff -u -r0 -r1.1 vc.sav
  --- /dev/null 2003-08-05 12:55:34.000000000 +0200
  +++ vc.sav    2003-08-05 12:55:34.000000000 +0200
  @@ -0,0 +1,30 @@
  +config = {
  +}
  +
  +prog sav:freebsd = {
  +  disabled
  +  comment = "cs: no tracking possible"
  +  version = 2.14
  +  url     = http://www.sophos.com/products/sav/
  +  regex   = freebsd.elf.tar.Z
  +}
  +prog sav:ides = {
  +  version   = 372
  +  url       = http://www.sophos.com/downloads/ide/
  +  regex     = (__VER__)_ides.zip
  +}
  +prog sav:linux = {
  +  disabled
  +  comment = "cs: no tracking possible"
  +  version = 2.14
  +  url     = http://www.sophos.com/products/sav/
  +  regex   = linux.intel.libc6.tar.Z
  +}
  +prog sav:solaris = {
  +  disabled
  +  comment = "cs: no tracking possible"
  +  version = 2.14
  +  url     = http://www.sophos.com/products/sav/
  +  regex   = solaris.sparc.tar.Z
  +}
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/sav/rc.sav
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rc.sav
  --- /dev/null 2003-08-05 12:55:36.000000000 +0200
  +++ rc.sav    2003-08-05 12:55:36.000000000 +0200
  @@ -0,0 +1,12 @@
  [EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
  +##
  +##  rc.sav -- Run-Commands
  +##
  +
  +%config
  +    sav_enable="$openpkg_rc_def"
  +
  +%daily -u @l_susr@
  +    rcService sav enable yes || exit 0
  +    #   FIXME: cs: periodic virus pattern fetching
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/sav/sav.conf
  ============================================================================
  $ cvs diff -u -r0 -r1.1 sav.conf
  --- /dev/null 2003-08-05 12:55:36.000000000 +0200
  +++ sav.conf  2003-08-05 12:55:36.000000000 +0200
  @@ -0,0 +1 @@
  +SAV virus data directory = @l_prefix@/var/sav/data
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/sav/sav.spec
  ============================================================================
  $ cvs diff -u -r1.14 -r1.15 sav.spec
  --- openpkg-src/sav/sav.spec  23 Jul 2003 13:32:21 -0000      1.14
  +++ openpkg-src/sav/sav.spec  5 Aug 2003 10:55:36 -0000       1.15
  @@ -24,28 +24,30 @@
   ##
   
   #   package versions
  -%define       V_full       3.56
  -%define       V_short      356
  +%define       V_sav        2.14
  +%define       V_ide        372
   
   #   package information
   Name:         sav
  -Summary:      SOPHOS Anti-Virus
  -URL:          http://www.sophos.com/
  -Vendor:       SOPHOS
  +Summary:      Sophos Anti-Virus
  +URL:          http://www.sophos.com/products/sav/
  +Vendor:       Sophos Plc.
   Packager:     The OpenPKG Project
   Distribution: OpenPKG [EVAL]
  -Group:        Filesystem
  +Group:        System
   License:      Commercial/Free-Trail
  -Version:      %{V_full}
  -Release:      20030723
  +Version:      %{V_sav}
  +Release:      20030805
   
   #   list of sources
  -Source0:      http://www.sophos.com/downloads/ide/%{V_short}_ides.zip
  +Source0:      http://www.sophos.com/downloads/ide/%{V_ide}_ides.zip
   Source1:      http://downloads.sophos.com/dp/full/freebsd.elf.tar.Z
   Source2:      http://downloads.sophos.com/dp/full/linux.intel.libc6.tar.Z
   Source3:      http://downloads.sophos.com/dp/full/solaris.sparc.tar.Z
  -Source4:      sweep.sh
  -Source5:      ftp://ftp.openpkg.org/sources/DST/sav/freebsd.libc.so.3
  +Source4:      rc.sav
  +Source5:      sav.conf
  +Source6:      sweep.sh
  +Source7:      wrap_open.c
   %NoSource     0
   %NoSource     1
   %NoSource     2
  @@ -54,63 +56,106 @@
   #   build information
   Prefix:       %{l_prefix}
   BuildRoot:    %{l_buildroot}
  -BuildPreReq:  OpenPKG, openpkg >= 20030717, infozip
  +BuildPreReq:  OpenPKG, openpkg >= 20030717, gcc, infozip
   PreReq:       OpenPKG, openpkg >= 20030717
   AutoReq:      no
   AutoReqProv:  no
   
   %description
  -    This is the free-trail version of the SOPHOS Anti-Virus
  -    command line virus scanner for Unix.
  +    This is the free-trail version of the Sophos Anti-Virus virus
  +    scanner for Unix.
   
   %prep
       %integrity
       %setup -q -T -c
  +
  +    #   select and decompress platform specific anti-virus engine
       case "%{l_target}" in
  -        *-freebsd* ) engine="%{SOURCE1}" ;;
  -        *-linux*   ) engine="%{SOURCE2}" ;;
  -        *-solaris* ) engine="%{SOURCE3}" ;;
  +        *-freebsd* ) engine="%{SOURCE freebsd.elf.tar.Z}" ;;
  +        *-linux*   ) engine="%{SOURCE linux.intel.libc6.tar.Z}" ;;
  +        *-solaris* ) engine="%{SOURCE solaris.sparc.tar.Z}" ;;
           * ) echo "Sorry, platform %{l_target} not supported" 1>&2; exit 1 ;;
       esac
       %{l_gzip} -d -c $engine | %{l_tar} xf -
  +
  +    #   decompress identity files (IDEs)
       ( mkdir ides; cd ides;
  -      %{l_prefix}/bin/unzip -x %{SOURCE0}
  +      %{l_prefix}/bin/unzip -x %{SOURCE %{V_ide}_ides.zip}
       ) || exit $?
   
  +    #   prepare open() wrapper (/etc/sav.conf -> %{l_prefix}/etc/sav/sav.conf)
  +    %{l_shtool} install -c -m 644 %{l_value -s -a} %{SOURCE wrap_open.c} ./
  +
   %build
  -    #   no-op
  +    %{l_cc} -ldl -shared -s -o wrap_open.so wrap_open.c
   
   %install
       rm -rf $RPM_BUILD_ROOT
  +
  +    #   create directory structure
       %{l_shtool} mkdir -f -p -m 755 \
           $RPM_BUILD_ROOT%{l_prefix}/bin \
           $RPM_BUILD_ROOT%{l_prefix}/etc/sav \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  +        $RPM_BUILD_ROOT%{l_prefix}/lib/sav \
           $RPM_BUILD_ROOT%{l_prefix}/libexec/sav \
  -        $RPM_BUILD_ROOT%{l_prefix}/man/man1
  -    ( cd sav-install
  -      %{l_shtool} subst -e 's;chown;true;g' -e 's;chgrp;true;g' install.sh
  -      %{l_bash} install.sh -readytogo -v \
  -          -d $RPM_BUILD_ROOT%{l_prefix} \
  -          -b $RPM_BUILD_ROOT%{l_prefix}/libexec/sav \
  -          -l $RPM_BUILD_ROOT%{l_prefix}/libexec/sav \
  -          -m $RPM_BUILD_ROOT%{l_prefix}/man \
  -          -s $RPM_BUILD_ROOT%{l_prefix}/share/sav \
  -          -ni -nssi -nrm
  +        $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/sav/data
  +
  +    #   install open() wrapper library
  +    %{l_shtool} install -c -m 755 \
  +        wrap_open.so \
  +        $RPM_BUILD_ROOT%{l_prefix}/libexec/sav/
  +
  +    #   install binary wrapper script
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE sweep.sh} \
  +        $RPM_BUILD_ROOT%{l_prefix}/bin/sweep
  +
  +    #   install run-command script
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE rc.sav} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +
  +    #   install default configuration
  +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
  +        %{SOURCE sav.conf} \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/sav/
  +
  +    #   install SAVI library and add compatibility links
  +    %{l_shtool} install -c -m 755 \
  +        sav-install/libsavi.so.3.* \
  +        $RPM_BUILD_ROOT%{l_prefix}/lib/sav/
  +    ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/sav
  +      %{l_shtool} mkln -s -f libsavi.so.3* libsavi.so.3
  +      %{l_shtool} mkln -s -f libsavi.so.3* libsavi.so.2
  +      %{l_shtool} mkln -s -f libsavi.so.3* libsavi.so
       ) || exit $?
  +
  +    #   install original binary
  +    %{l_shtool} install -c -m 755 \
  +        sav-install/sweep \
  +        $RPM_BUILD_ROOT%{l_prefix}/libexec/sav/sweep.bin
  +
  +    #   install man page
  +    %{l_shtool} install -c -m 644 \
  +        sav-install/sweep.1 \
  +        $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  +
  +    #   install virus description and identity files
  +    %{l_shtool} install -c -m 644 \
  +        sav-install/vdl-*.dat \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/sav/data/vdl.dat
  +    %{l_shtool} install -c -m 644 \
  +        sav-install/vdl*.vdb \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/sav/data/
       for ide in ides/*.ide; do
           %{l_shtool} install -c -m 644 \
  -           $ide $RPM_BUILD_ROOT%{l_prefix}/share/sav/
  +           $ide $RPM_BUILD_ROOT%{l_prefix}/var/sav/data/
       done
  -    case "%{l_target}" in
  -        *-freebsd* )
  -            %{l_shtool} install -c -m 755 \
  -                %{SOURCE freebsd.libc.so.3} \
  -                $RPM_BUILD_ROOT%{l_prefix}/libexec/sav/libc.so.3
  -            ;;
  -    esac
  -    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  -        %{SOURCE sweep.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/sweep
  -    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  +
  +    #   generate file list
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  +        '%config %{l_prefix}/etc/sav/*'
   
   %files -f files
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/sav/sweep.sh
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 sweep.sh
  --- openpkg-src/sav/sweep.sh  24 Mar 2002 19:28:04 -0000      1.1
  +++ openpkg-src/sav/sweep.sh  5 Aug 2003 10:55:36 -0000       1.2
  @@ -1,6 +1,17 @@
   #!/bin/sh
  -LD_LIBRARY_PATH="@l_prefix@/libexec/sav:/usr/lib:$LD_LIBRARY_PATH"
  +##
  +##  sweep - Sophos Anti-Virus binary wrapper
  +##
  +
  +#   force DSO to be pre-loaded
  +LD_PRELOAD="@l_prefix@/libexec/sav/wrap_open.so"
  +export LD_PRELOAD
  +
  +LD_LIBRARY_PATH="@l_prefix@/lib/sav:/usr/lib:/lib:$LD_LIBRARY_PATH"
   export LD_LIBRARY_PATH
  -SAV_IDE="@l_prefix@/share/sav"
  +SAV_IDE="@l_prefix@/var/sav/data"
   export SAV_IDE
  -exec @l_prefix@/libexec/sav/sweep "$@"
  +
  +#   execute original executable
  +exec @l_prefix@/libexec/sav/sweep.bin "$@"
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/sav/wrap_open.c
  ============================================================================
  $ cvs diff -u -r0 -r1.1 wrap_open.c
  --- /dev/null 2003-08-05 12:55:36.000000000 +0200
  +++ wrap_open.c       2003-08-05 12:55:36.000000000 +0200
  @@ -0,0 +1,22 @@
  +/*
  + * gcc -ldl -shared -o open.so open.c
  + * LD_PRELOAD=/path/to/open.so
  + * export LD_PRELOAD
  + */
  +
  +#include <features.h>
  +#define __USE_GNU
  +#include <dlfcn.h>
  +#undef __USE_GNU
  +#include <stdio.h>
  +#include <string.h>
  +
  +int __open(const char *path, int flags) {
  +    if(strcmp(path, "/etc/sav.conf") == 0)
  +        path = "@l_prefix@/etc/sav/sav.conf";
  +
  +    int (*orig_func) (const char *, int) = dlsym(RTLD_NEXT, "__open");
  +
  +    return orig_func(path, flags);
  +}
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/news.txt
  ============================================================================
  $ cvs diff -u -r1.6032 -r1.6033 news.txt
  --- openpkg-web/news.txt      5 Aug 2003 07:43:34 -0000       1.6032
  +++ openpkg-web/news.txt      5 Aug 2003 10:55:34 -0000       1.6033
  @@ -1,3 +1,4 @@
  +05-Aug-2003: Upgraded package: P<sav-2.14-20030805>
   05-Aug-2003: Upgraded package: P<netrik-1.10.3-20030805>
   05-Aug-2003: Upgraded package: P<dsh-0.24.0-20030805>
   05-Aug-2003: Upgraded package: P<bogofilter-0.14.3-20030805>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to