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

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   26-Jun-2008 08:55:24
  Branch: HEAD                             Handle: 2008062607552100

  Added files:
    openpkg-src/milter-bogom
                            fsl.milter-bogom milter-bogom.patch
                            milter-bogom.spec rc.milter-bogom

  Log:
    new package: milter-bogom 1.9.2 (Mail Filter for BogoFilter)

  Summary:
    Revision    Changes     Path
    1.1         +16 -0      openpkg-src/milter-bogom/fsl.milter-bogom
    1.1         +12 -0      openpkg-src/milter-bogom/milter-bogom.patch
    1.1         +151 -0     openpkg-src/milter-bogom/milter-bogom.spec
    1.1         +61 -0      openpkg-src/milter-bogom/rc.milter-bogom
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/milter-bogom/fsl.milter-bogom
  ============================================================================
  $ cvs diff -u -r0 -r1.1 fsl.milter-bogom
  --- /dev/null 2008-06-26 08:55:00 +0200
  +++ fsl.milter-bogom  2008-06-26 08:55:23 +0200
  @@ -0,0 +1,16 @@
  +##
  +##  fsl.milter-bogom -- OSSP fsl configuration
  +##
  +
  +ident (bogom)/.+ q{
  +    prefix(
  +        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
  +    )
  +    -> {
  +        debug: file(
  +            path="@l_prefix@/var/milter-bogom/milter-bogom.log",
  +            perm=0644
  +        )
  +    }
  +};
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/milter-bogom/milter-bogom.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 milter-bogom.patch
  --- /dev/null 2008-06-26 08:55:00 +0200
  +++ milter-bogom.patch        2008-06-26 08:55:23 +0200
  @@ -0,0 +1,12 @@
  +Index: milter.c
  +--- milter.c.orig    2008-06-25 23:47:40 +0200
  ++++ milter.c 2008-06-26 08:32:58 +0200
  +@@ -41,7 +41,7 @@
  + #include <fcntl.h>
  + #endif
  + 
  +-#include "libmilter/mfapi.h"
  ++#include "milter/mfapi.h"
  + #include "conf.h"
  + 
  + /* defaults */
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/milter-bogom/milter-bogom.spec
  ============================================================================
  $ cvs diff -u -r0 -r1.1 milter-bogom.spec
  --- /dev/null 2008-06-26 08:55:00 +0200
  +++ milter-bogom.spec 2008-06-26 08:55:23 +0200
  @@ -0,0 +1,151 @@
  +##
  +##  milter-bogom.spec -- OpenPKG RPM Package Specification
  +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  +##
  +##  Permission to use, copy, modify, and distribute this software for
  +##  any purpose with or without fee is hereby granted, provided that
  +##  the above copyright notice and this permission notice appear in all
  +##  copies.
  +##
  +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  +##  SUCH DAMAGE.
  +##
  +
  +#   package information
  +Name:         milter-bogom
  +Summary:      Mail Filter for BogoFilter
  +URL:          http://www.usebox.net/jjm/bogom/
  +Vendor:       Juan J. Martinez
  +Packager:     OpenPKG Foundation e.V.
  +Distribution: OpenPKG Community
  +Class:        EVAL
  +Group:        Mail
  +License:      Open Source
  +Version:      1.9.2
  +Release:      20080626
  +
  +#   package options
  +%option       with_fsl  yes
  +
  +#   list of sources
  +Source0:      http://www.usebox.net/jjm/bogom/bogom-%{version}.tar.gz
  +Source1:      rc.milter-bogom
  +Source2:      fsl.milter-bogom
  +Patch0:       milter-bogom.patch
  +
  +#   build information
  +Prefix:       %{l_prefix}
  +BuildRoot:    %{l_buildroot}
  +BuildPreReq:  OpenPKG, openpkg >= 20060823
  +PreReq:       OpenPKG, openpkg >= 20060823, bogofilter
  +BuildPreReq:  milter
  +PreReq:       milter
  +%if "%{with_fsl}" == "yes"
  +BuildPreReq:  fsl
  +PreReq:       fsl
  +%endif
  +AutoReq:      no
  +AutoReqProv:  no
  +
  +%description
  +    This is a Mail spam-filter using the bogofilter(1) bayesian filter,
  +    based on the MILTER API of MTAs.
  +
  +%track
  +    prog milter-bogom = {
  +        version   = %{version}
  +        url       = http://www.usebox.net/jjm/bogom/
  +        regex     = bogom-(\d+(\.\d+)+)\.tar\.gz
  +    }
  +
  +%prep
  +    %setup -q -n bogom-%{version}
  +    %patch -p0
  +
  +%build
  +    %{l_shtool} subst \
  +        -e 's;\(DEF_USER\)[^"]*"[^"]*";\1 "%{l_rusr}";' \
  +        -e 's;\(DEF_CONN\)[^"]*"[^"]*";\1 
"unix:%{l_prefix}/var/milter/socket/milter-bogom";' \
  +        -e 's;\(DEF_CONF\)[^"]*"[^"]*";\1 
"%{l_prefix}/etc/milter-bogom/milter-bogom.conf";' \
  +        -e 's;\(DEF_PIDFILE\)[^"]*"[^"]*";\1 
"%{l_prefix}/var/milter-bogom/milter-bogom.pid";' \
  +        -e 's;/usr/local/bin/bogofilter;%{l_prefix}/bin/bogofilter;' \
  +        milter.c
  +    libs="-lmilter"
  +    case "%{l_platform -p}" in
  +        *-solaris* ) libs="$libs -lsocket -lnsl" ;;
  +    esac
  +    %{l_make} %{l_mflags} \
  +        CC="%{l_cc}" \
  +        CPPFLAGS="%{l_cppflags}" \
  +        CFLAGS="%{l_cflags -O} -pthread" \
  +        LDFLAGS="%{l_ldflags} -pthread %{l_fsl_ldflags}" \
  +        LIBS="$libs %{l_fsl_libs}"
  +
  +%install
  +    #   create installation hierarchy
  +    rm -rf $RPM_BUILD_ROOT
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/milter-bogom \
  +        $RPM_BUILD_ROOT%{l_prefix}/sbin \
  +        $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/milter-bogom
  +
  +    #   install program
  +    %{l_shtool} install -c -s -m 755 \
  +        bogom $RPM_BUILD_ROOT%{l_prefix}/sbin/
  +
  +    #   install manual page
  +    %{l_shtool} install -c -m 644 \
  +        bogom.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  +
  +    #   install configuration
  +    %{l_shtool} install -c -m 644 \
  +        bogom.conf-example 
$RPM_BUILD_ROOT%{l_prefix}/etc/milter-bogom/bogom.conf
  +
  +    #   install run-command script
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE rc.milter-bogom} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +
  +    #   install OSSP fsl configuration
  +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
  +        %{SOURCE fsl.milter-bogom} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  +
  +    #   determine installation files
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  +        %{l_files_std} \
  +        '%config %{l_prefix}/etc/fsl/*' \
  +        '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/milter-bogom'
  +
  +%files -f files
  +
  +%clean
  +    rm -rf $RPM_BUILD_ROOT
  +
  +%post
  +    #   after upgrade, restart service
  +    if [ $1 -eq 2 ]; then
  +        eval `%{l_rc} milter-bogom status 2>/dev/null`
  +        [ ".$milter_bogom_active" = .yes ] && %{l_rc} milter-bogom restart
  +    fi
  +    exit 0
  +
  +%preun
  +    #   before erase, stop service and remove log files
  +    if [ $1 -eq 0 ]; then
  +        %{l_rc} milter-bogom stop 2>/dev/null
  +        rm -f $RPM_INSTALL_PREFIX/etc/milter-bogom/* >/dev/null 2>&1 || true
  +    fi
  +    exit 0
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/milter-bogom/rc.milter-bogom
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rc.milter-bogom
  --- /dev/null 2008-06-26 08:55:00 +0200
  +++ rc.milter-bogom   2008-06-26 08:55:24 +0200
  @@ -0,0 +1,61 @@
  [EMAIL PROTECTED]@/bin/openpkg rc
  +##
  +##  rc.milter-bogom -- Run-Commands
  +##
  +
  +%config
  +    milter_bogom_enable="$openpkg_rc_def"
  +    milter_bogom_flags=""
  +    milter_bogom_prolog="true"
  +    milter_bogom_epilog="true"
  +    milter_bogom_numfiles="10"
  +    milter_bogom_minsize="1M"
  +    milter_bogom_complevel="9"
  +
  +%common
  +    milter_bogom_pidfile="@l_prefix@/var/milter-bogom/milter-bogom.pid"
  +    milter_bogom_logfile="@l_prefix@/var/milter-bogom/milter-bogom.log"
  +    milter_bogom_socket="@l_prefix@/var/milter/socket/milter-bogom"
  +    milter_bogom_signal () {
  +        [ -f $milter_bogom_pidfile ] && kill -$1 `cat $milter_bogom_pidfile`
  +    }
  +
  +%status -u @l_susr@ -o
  +    milter_bogom_usable="unknown"
  +    milter_bogom_active="no"
  +    rcService milter-bogom enable yes && \
  +        milter_bogom_signal 0 && milter_bogom_active="yes"
  +    echo "milter_bogom_enable=\"$milter_bogom_enable\""
  +    echo "milter_bogom_usable=\"$milter_bogom_usable\""
  +    echo "milter_bogom_active=\"$milter_bogom_active\""
  +
  +%start -u @l_susr@
  +    rcService milter-bogom enable yes || exit 0
  +    rcService milter-bogom active yes && exit 0
  +    ( umask 002
  +      rm -f $milter_bogom_socket >/dev/null 2>&1 || true
  +      @l_prefix@/sbin/bogom $milter_bogom_flags
  +    ) || exit $?
  +
  +%stop -u @l_susr@
  +    rcService milter-bogom enable yes || exit 0
  +    rcService milter-bogom active no  && exit 0
  +    milter_bogom_signal TERM
  +    sleep 2
  +    rm -f $milter_bogom_pidfile >/dev/null 2>&1 || true
  +    rm -f $milter_bogom_socket  >/dev/null 2>&1 || true
  +
  +%restart -u @l_susr@
  +    rcService milter-bogom enable yes || exit 0
  +    rcService milter-bogom active no  && exit 0
  +    rc milter-bogom stop start
  +
  +%daily -u @l_susr@
  +    rcService milter-bogom enable yes || exit 0
  +    shtool rotate -f \
  +        -n $milter_bogom_numfiles -s $milter_bogom_minsize -d \
  +        -z $milter_bogom_complevel -m 644 -o @l_rusr@ -g @l_rgrp@ \
  +        -P "$milter_bogom_prolog" \
  +        -E "$milter_bogom_epilog; rc milter-bogom restart" \
  +        $milter_bogom_logfile
  +
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to