Import package vendor original specs for necessary manipulations.

Sun, 01 Nov 2009 15:42:37 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 01 Nov 2009 15:42:37 +0100
changeset 226
91cd1b1cd15b
parent 225
a01e65d97743
child 227
e003f051ba1d

Import package vendor original specs for necessary manipulations.

clamav/clamav.patch file | annotate | diff | comparison | revisions
clamav/clamav.spec file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/clamav/clamav.patch	Sun Nov 01 15:42:37 2009 +0100
     1.3 @@ -0,0 +1,84 @@
     1.4 +Index: clamav-milter/clamav-milter.c
     1.5 +--- clamav-milter/clamav-milter.c.orig	2009-04-01 13:48:54 +0200
     1.6 ++++ clamav-milter/clamav-milter.c	2009-04-09 17:25:12 +0200
     1.7 +@@ -32,7 +32,7 @@
     1.8 + #include <syslog.h>
     1.9 + #endif
    1.10 + #include <time.h>
    1.11 +-#include <libmilter/mfapi.h>
    1.12 ++#include "milter/mfapi.h"
    1.13 + 
    1.14 + #include "clamav.h"
    1.15 + 
    1.16 +Index: clamav-milter/clamfi.c
    1.17 +--- clamav-milter/clamfi.c.orig	2009-04-02 18:36:34 +0200
    1.18 ++++ clamav-milter/clamfi.c	2009-04-09 17:25:12 +0200
    1.19 +@@ -29,7 +29,7 @@
    1.20 + #include <unistd.h>
    1.21 + #include <ctype.h>
    1.22 + 
    1.23 +-#include <libmilter/mfapi.h>
    1.24 ++#include "milter/mfapi.h"
    1.25 + 
    1.26 + #include "shared/optparser.h"
    1.27 + #include "shared/output.h"
    1.28 +Index: clamav-milter/clamfi.h
    1.29 +--- clamav-milter/clamfi.h.orig	2009-03-16 19:37:26 +0100
    1.30 ++++ clamav-milter/clamfi.h	2009-04-09 17:25:12 +0200
    1.31 +@@ -22,7 +22,7 @@
    1.32 + #define _CLAMFI_H
    1.33 + 
    1.34 + #include "shared/optparser.h"
    1.35 +-#include <libmilter/mfapi.h>
    1.36 ++#include "milter/mfapi.h"
    1.37 + 
    1.38 + extern uint64_t maxfilesize;
    1.39 + extern int addxvirus;
    1.40 +Index: configure
    1.41 +--- configure.orig	2009-04-08 16:38:23 +0200
    1.42 ++++ configure	2009-04-09 17:25:12 +0200
    1.43 +@@ -20949,9 +20949,6 @@
    1.44 + 
    1.45 +         save_LIBS="$LIBS"
    1.46 +     CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
    1.47 +-    if test -d /usr/lib/libmilter ; then
    1.48 +-	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter"
    1.49 +-    fi
    1.50 +     LIBS="$LIBS -lmilter $CLAMAV_MILTER_LIBS"
    1.51 +     { $as_echo "$as_me:$LINENO: checking for mi_stop in -lmilter" >&5
    1.52 + $as_echo_n "checking for mi_stop in -lmilter... " >&6; }
    1.53 +@@ -21191,7 +21188,7 @@
    1.54 + 
    1.55 +     LIBS="$save_LIBS"
    1.56 + 
    1.57 +-for ac_header in libmilter/mfapi.h
    1.58 ++for ac_header in milter/mfapi.h
    1.59 + do
    1.60 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
    1.61 + if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
    1.62 +Index: libclamav/others.c
    1.63 +--- libclamav/others.c.orig	2009-04-03 10:33:24 +0200
    1.64 ++++ libclamav/others.c	2009-04-09 17:29:05 +0200
    1.65 +@@ -176,8 +176,10 @@
    1.66 +     if(is_rar_initd) return;
    1.67 +     is_rar_initd = 1;
    1.68 + 
    1.69 ++#if 0
    1.70 +     rhandle = lt_dlfind("libclamunrar_iface", "unrar");
    1.71 +     if (!rhandle)
    1.72 ++#endif
    1.73 + 	return;
    1.74 + 
    1.75 +     if (!(cli_unrar_open = (int(*)(int, const char *, unrar_state_t *))lt_dlsym(rhandle, "libclamunrar_iface_LTX_unrar_open")) ||
    1.76 +Index: shared/output.c
    1.77 +--- shared/output.c.orig	2009-03-16 19:37:26 +0100
    1.78 ++++ shared/output.c	2009-04-09 17:25:12 +0200
    1.79 +@@ -67,7 +67,7 @@
    1.80 + pthread_mutex_t logg_mutex = PTHREAD_MUTEX_INITIALIZER;
    1.81 + #endif
    1.82 + 
    1.83 +-#ifdef  C_LINUX
    1.84 ++#if 0
    1.85 + #include <libintl.h>
    1.86 + #include <locale.h>
    1.87 + 
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/clamav/clamav.spec	Sun Nov 01 15:42:37 2009 +0100
     2.3 @@ -0,0 +1,190 @@
     2.4 +##
     2.5 +##  clamav.spec -- OpenPKG RPM Package Specification
     2.6 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +#   package information
    2.28 +Name:         clamav
    2.29 +Summary:      Clam Antivirus
    2.30 +URL:          http://www.clamav.net/
    2.31 +Vendor:       Tomasz Kojm
    2.32 +Packager:     OpenPKG Foundation e.V.
    2.33 +Distribution: OpenPKG Community
    2.34 +Class:        EVAL
    2.35 +Group:        AntiVirus
    2.36 +License:      GPL
    2.37 +Version:      0.95.2
    2.38 +Release:      20090702
    2.39 +
    2.40 +#   package options
    2.41 +%option       with_milter  no
    2.42 +
    2.43 +#   list of sources
    2.44 +Source0:      http://switch.dl.sourceforge.net/clamav/clamav-%{version}.tar.gz
    2.45 +Source1:      rc.clamav
    2.46 +Patch0:       clamav.patch
    2.47 +
    2.48 +#   build information
    2.49 +Prefix:       %{l_prefix}
    2.50 +BuildRoot:    %{l_buildroot}
    2.51 +BuildPreReq:  OpenPKG, openpkg >= 20060823, gcc, bzip2, pkgconfig, bc
    2.52 +PreReq:       OpenPKG, openpkg >= 20060823
    2.53 +BuildPreReq:  zlib, bzip2, curl, gmp, libiconv, openssl
    2.54 +PreReq:       zlib, bzip2, curl, gmp, libiconv, openssl
    2.55 +%if "%{with_milter}" == "yes"
    2.56 +BuildPreReq:  milter
    2.57 +PreReq:       milter
    2.58 +%endif
    2.59 +AutoReq:      no
    2.60 +AutoReqProv:  no
    2.61 +
    2.62 +%description
    2.63 +    Clam AntiVirus is an anti-virus toolkit for UNIX. The main
    2.64 +    purpose of this software is the integration with mail servers
    2.65 +    (attachment scanning). The package provides a flexible and scalable
    2.66 +    multi-threaded daemon, a command line scanner, and a tool for
    2.67 +    automatic updating via Internet. The programs are based on a shared
    2.68 +    library distributed with the Clam AntiVirus package, which you can
    2.69 +    use with your own software. The virus database is based on the virus
    2.70 +    database from OpenAntiVirus, but contains additional signatures.
    2.71 +
    2.72 +%track
    2.73 +    prog clamav = {
    2.74 +        version   = %{version}
    2.75 +        url       = http://sourceforge.net/projects/clamav/files/
    2.76 +        regex     = clamav-(\d+\.\d+(\.\d+)*)\.tar\.gz
    2.77 +    }
    2.78 +
    2.79 +%prep
    2.80 +    %setup -q
    2.81 +    %patch -p0
    2.82 +
    2.83 +%build
    2.84 +    #   configure package
    2.85 +    CC="%{l_cc}" \
    2.86 +    CFLAGS="%{l_cflags -O}" \
    2.87 +    CPPFLAGS="%{l_cppflags}" \
    2.88 +    LDFLAGS="%{l_ldflags}" \
    2.89 +    GREP="grep" \
    2.90 +    ./configure \
    2.91 +        --prefix=%{l_prefix} \
    2.92 +        --mandir=%{l_prefix}/man \
    2.93 +        --sysconfdir=%{l_prefix}/etc/clamav \
    2.94 +        --with-zlib=%{l_prefix} \
    2.95 +        --with-libcurl \
    2.96 +        --with-user=%{l_rusr} \
    2.97 +        --with-group=%{l_rgrp} \
    2.98 +        --without-tcpwrappers \
    2.99 +        --disable-clamav \
   2.100 +        --disable-clamuko \
   2.101 +        --disable-urandom \
   2.102 +        --disable-cr \
   2.103 +%if "%{with_milter}" == "yes"
   2.104 +        --enable-milter \
   2.105 +        --with-sendmail=/dev/null \
   2.106 +%else
   2.107 +        --disable-milter \
   2.108 +%endif
   2.109 +        --disable-unrar \
   2.110 +        --disable-shared
   2.111 +
   2.112 +    #   build package
   2.113 +    %{l_make} %{l_mflags -O}
   2.114 +
   2.115 +%install
   2.116 +    rm -rf $RPM_BUILD_ROOT
   2.117 +
   2.118 +    #   perform standard package installation
   2.119 +    %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   2.120 +
   2.121 +    #   install default configuration
   2.122 +    %{l_shtool} mkdir -f -p -m 755 \
   2.123 +        $RPM_BUILD_ROOT%{l_prefix}/etc/clamav
   2.124 +    %{l_shtool} install -c -m 644 \
   2.125 +        -e 's;^\(Example\);#\1;' \
   2.126 +        -e 's;^#\(LogFile\) /.*;\1 %{l_prefix}/var/clamav/clamd.log;' \
   2.127 +        -e 's;^#\(LogTime.*\);\1;' \
   2.128 +        -e 's;^#\(PidFile\).*;\1 %{l_prefix}/var/clamav/clamd.pid;' \
   2.129 +        -e 's;^\(LocalSocket\).*;\1 %{l_prefix}/var/clamav/clamd.sock;' \
   2.130 +        -e 's;^#\(FixStaleSocket.*\);\1;' \
   2.131 +        -e 's;^#\(DatabaseDirectory\).*;\1 %{l_prefix}/share/clamav;' \
   2.132 +        -e 's;^#\(User\).*;\1 %{l_rusr};' \
   2.133 +        etc/clamd.conf \
   2.134 +        $RPM_BUILD_ROOT%{l_prefix}/etc/clamav/
   2.135 +    %{l_shtool} install -c -m 644 \
   2.136 +        -e 's;^\(Example\);#\1;' \
   2.137 +        -e 's;^#\(DatabaseDirectory\).*;\1 %{l_prefix}/share/clamav;' \
   2.138 +        -e 's;^#\(UpdateLogFile\).*;\1 %{l_prefix}/var/clamav/freshclam.log;' \
   2.139 +        -e 's;^#\(NotifyClamd\).*;\1 %{l_prefix}/etc/clamav/clamd.conf;' \
   2.140 +        etc/freshclam.conf \
   2.141 +        $RPM_BUILD_ROOT%{l_prefix}/etc/clamav/
   2.142 +
   2.143 +    #   install run-command script
   2.144 +    %{l_shtool} mkdir -f -p -m 755 \
   2.145 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   2.146 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   2.147 +        %{SOURCE rc.clamav} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   2.148 +
   2.149 +    #   strip-down installation hierarchy
   2.150 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/*  >/dev/null 2>&1 || true
   2.151 +    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
   2.152 +%if "%{with_milter}" == "no"
   2.153 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/clamav-milter.8
   2.154 +%endif
   2.155 +
   2.156 +    #   create additional installation directory
   2.157 +    %{l_shtool} mkdir -f -p -m 755 \
   2.158 +        $RPM_BUILD_ROOT%{l_prefix}/var/clamav
   2.159 +
   2.160 +    #   determine installation files
   2.161 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   2.162 +        %{l_files_std} \
   2.163 +        '%config %{l_prefix}/etc/clamav/*.conf' \
   2.164 +        '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/clamav' \
   2.165 +        '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/clamav'
   2.166 +
   2.167 +%files -f files
   2.168 +
   2.169 +%clean
   2.170 +    rm -rf $RPM_BUILD_ROOT
   2.171 +
   2.172 +%pre
   2.173 +    #   before upgrade, save status and stop service
   2.174 +    [ $1 -eq 2 ] || exit 0
   2.175 +    eval `%{l_rc} clamav status 2>/dev/null | tee %{l_tmpfile}`
   2.176 +    %{l_rc} clamav stop 2>/dev/null
   2.177 +    exit 0
   2.178 +
   2.179 +%post
   2.180 +    if [ $1 -eq 2 ]; then
   2.181 +        #   after upgrade, restore status
   2.182 +        eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
   2.183 +        [ ".$clamav_active" = .yes ] && %{l_rc} clamav start
   2.184 +    fi
   2.185 +    exit 0
   2.186 +
   2.187 +%preun
   2.188 +    #   before erase, stop service and remove log files
   2.189 +    [ $1 -eq 0 ] || exit 0
   2.190 +    %{l_rc} clamav stop 2>/dev/null
   2.191 +    rm -f $RPM_INSTALL_PREFIX/var/clamav/*.log* >/dev/null 2>&1 || true
   2.192 +    exit 0
   2.193 +

mercurial