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

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  r...@openpkg.org
  Module: openpkg-src                      Date:   26-Aug-2009 22:57:33
  Branch: HEAD                             Handle: 2009082621573300

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

  Log:
    new package: opendkim 1.0.0 (DKIM Sender Authentication for Mail)

  Summary:
    Revision    Changes     Path
    1.1         +16 -0      openpkg-src/opendkim/fsl.opendkim
    1.1         +45 -0      openpkg-src/opendkim/opendkim.patch
    1.1         +169 -0     openpkg-src/opendkim/opendkim.spec
    1.1         +82 -0      openpkg-src/opendkim/rc.opendkim
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/opendkim/fsl.opendkim
  ============================================================================
  $ cvs diff -u -r0 -r1.1 fsl.opendkim
  --- /dev/null 2009-08-26 22:56:46 +0200
  +++ fsl.opendkim      2009-08-26 22:57:33 +0200
  @@ -0,0 +1,16 @@
  +##
  +##  fsl.opendkim -- OSSP fsl configuration
  +##
  +
  +ident (opendkim)/.+ q{
  +    prefix(
  +        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
  +    )
  +    -> {
  +        debug: file(
  +            path="@l_prefix@/var/opendkim/opendkim.log",
  +            perm=0644
  +        )
  +    }
  +};
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/opendkim/opendkim.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 opendkim.patch
  --- /dev/null 2009-08-26 22:56:46 +0200
  +++ opendkim.patch    2009-08-26 22:57:33 +0200
  @@ -0,0 +1,45 @@
  +Index: configure
  +--- configure.orig   2009-08-14 18:44:47 +0200
  ++++ configure        2009-08-25 08:49:00 +0200
  +@@ -22774,7 +22774,7 @@
  + then
  +     for d in $milterdirs
  +     do
  +-            if test -f $d/include/libmilter/mfapi.h
  ++            if test -f $d/include/milter/mfapi.h
  +             then
  +                     milterpath=$d
  +                     break
  +@@ -22796,7 +22796,7 @@
  +    { (exit 1); exit 1; }; }
  +             ;;
  +     */*)
  +-            if ! test -f $milterpath/include/libmilter/mfapi.h
  ++            if ! test -f $milterpath/include/milter/mfapi.h
  +             then
  +                     { { $as_echo "$as_me:$LINENO: error: milter includes 
not found at $milterpath" >&5
  + $as_echo "$as_me: error: milter includes not found at $milterpath" >&2;}
  +Index: opendkim/opendkim.c
  +--- opendkim/opendkim.c.orig 2009-08-13 07:11:07 +0200
  ++++ opendkim/opendkim.c      2009-08-25 08:49:21 +0200
  +@@ -64,7 +64,7 @@
  + #endif /* ! _PATH_SENDMAIL */
  + 
  + /* libmilter includes */
  +-#include "libmilter/mfapi.h"
  ++#include "milter/mfapi.h"
  + 
  + /* libopendkim includes */
  + #include <dkim.h>
  +Index: opendkim/opendkim.h
  +--- opendkim/opendkim.h.orig 2009-07-23 20:05:39 +0200
  ++++ opendkim/opendkim.h      2009-08-25 08:49:15 +0200
  +@@ -23,7 +23,7 @@
  + #include <stdbool.h>
  + 
  + /* libmilter */
  +-#include <libmilter/mfapi.h>
  ++#include <milter/mfapi.h>
  + 
  + /* libopendkim */
  + #include <dkim.h>
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/opendkim/opendkim.spec
  ============================================================================
  $ cvs diff -u -r0 -r1.1 opendkim.spec
  --- /dev/null 2009-08-26 22:56:46 +0200
  +++ opendkim.spec     2009-08-26 22:57:33 +0200
  @@ -0,0 +1,169 @@
  +##
  +##  opendkim.spec -- OpenPKG RPM Package Specification
  +##  Copyright (c) 2000-2009 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:         opendkim
  +Summary:      DKIM Sender Authentication for Mail
  +URL:          http://www.opendkim.org/
  +Vendor:       OpenDKIM Project
  +Packager:     OpenPKG Foundation e.V.
  +Distribution: OpenPKG Community
  +Class:        EVAL
  +Group:        Mail
  +License:      BSD
  +Version:      1.0.0
  +Release:      20090826
  +
  +#   package options
  +%option       with_fsl  yes
  +
  +#   list of sources
  +Source0:      
http://switch.dl.sourceforge.net/opendkim/opendkim-%{version}.tar.gz
  +Source1:      fsl.opendkim
  +Source2:      rc.opendkim
  +Patch0:       opendkim.patch
  +
  +#   build information
  +Prefix:       %{l_prefix}
  +BuildRoot:    %{l_buildroot}
  +BuildPreReq:  OpenPKG, openpkg >= 20060823
  +PreReq:       OpenPKG, openpkg >= 20060823
  +BuildPreReq:  milter, openssl
  +PreReq:       milter, openssl
  +%if "%{with_fsl}" == "yes"
  +BuildPreReq:  fsl
  +PreReq:       fsl
  +%endif
  +AutoReq:      no
  +AutoReqProv:  no
  +
  +%description
  +    OpenDKIM is an implementation of the DomainKeys Identified Mail
  +    (DKIM) sender authentication system as proposed by the IETF RFC4871
  +    standard. The OpenDKIM package consists of a library that implements
  +    the DKIM service and a milter-based filter application that can plug
  +    in to any milter-aware MTA to provide that service to sufficiently
  +    recent Sendmail and Postfix MTAs and other MTAs that support the
  +    MILTER protocol.
  +
  +%track
  +    prog opendkim = {
  +        version   = %{version}
  +        url       = http://sourceforge.net/projects/opendkim/files/
  +        regex     = opendkim-(__VER__)\.tar\.gz
  +    }
  +
  +%prep
  +    %setup -q
  +    %patch -p0
  +
  +%build
  +    #   configure package
  +    CC="%{l_cc}" \
  +    CFLAGS="%{l_cflags -O}" \
  +    CPPFLAGS="%{l_cppflags}" \
  +    LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  +    LIBS="%{l_fsl_libs}" \
  +    ./configure \
  +        --prefix=%{l_prefix} \
  +        --mandir=%{l_prefix}/man \
  +        --with-openssl=%{l_prefix} \
  +        --with-milter=%{l_prefix} \
  +        --disable-shared
  +
  +    #   build package
  +    %{l_make} %{l_mflags -O}
  +
  +%install
  +    #   install package
  +    rm -rf $RPM_BUILD_ROOT
  +    %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  +
  +    #   strip down and post-adjust installation
  +    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/opendkim
  +    mv  $RPM_BUILD_ROOT%{l_prefix}/sbin/opendkim-genkey.sh \
  +        $RPM_BUILD_ROOT%{l_prefix}/sbin/opendkim-genkey
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/opendkim
  +    mv  $RPM_BUILD_ROOT%{l_prefix}/share/doc/opendkim/opendkim.conf.sample \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/opendkim/opendkim.conf
  +    %{l_shtool} subst \
  +        -e 's;^\([A-Z]\);#\1;' \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/opendkim/opendkim.conf
  +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share
  +
  +    #   install run-command script
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE rc.opendkim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +
  +    #   install OSSP fsl configuration
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
  +        %{SOURCE fsl.opendkim} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  +
  +    #   create run-time directory
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/opendkim \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/opendkim/opendkim.tmp
  +
  +    #   determine installation files
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  +        %{l_files_std} \
  +        '%config %{l_prefix}/etc/fsl/*' \
  +        '%config %{l_prefix}/etc/opendkim/*' \
  +        '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/opendkim/*' \
  +        '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/opendkim'
  +
  +%files -f files
  +
  +%clean
  +    rm -rf $RPM_BUILD_ROOT
  +
  +%post
  +    #   after upgrade, restart service
  +    if [ $1 -eq 1 ]; then
  +        if [ ! -f $RPM_INSTALL_PREFIX/etc/opendkim/mail.private ]; then
  +            $RPM_INSTALL_PREFIX/sbin/opendkim-genkey \
  +                -s mail -d example.com -D $RPM_INSTALL_PREFIX/etc/opendkim 
-b 1024
  +        fi
  +    elif [ $1 -eq 2 ]; then
  +        eval `%{l_rc} opendkim status 2>/dev/null`
  +        [ ".$opendkim_active" = .yes ] && %{l_rc} opendkim restart
  +    fi
  +    exit 0
  +
  +%preun
  +    #   before erase, stop service and remove log files
  +    if [ $1 -eq 0 ]; then
  +        %{l_rc} opendkim stop 2>/dev/null
  +        rm -f $RPM_INSTALL_PREFIX/etc/opendkim/mail.*          >/dev/null 
2>&1 || true
  +        rm -f $RPM_INSTALL_PREFIX/var/opendkim/opendkim.log    >/dev/null 
2>&1 || true
  +        rm -f $RPM_INSTALL_PREFIX/var/opendkim/opendkim.pid    >/dev/null 
2>&1 || true
  +        rm -f $RPM_INSTALL_PREFIX/var/opendkim/opendkim.tmp/*  >/dev/null 
2>&1 || true
  +    fi
  +    exit 0
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/opendkim/rc.opendkim
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rc.opendkim
  --- /dev/null 2009-08-26 22:56:46 +0200
  +++ rc.opendkim       2009-08-26 22:57:33 +0200
  @@ -0,0 +1,82 @@
  +...@l_prefix@/bin/openpkg rc
  +##
  +##  rc.opendkim -- Run-Commands
  +##
  +
  +%config
  +    opendkim_enable="$openpkg_rc_def"
  +    opendkim_selector="main"
  +    opendkim_domain="example.com"
  +    opendkim_keyfile="@l_prefix@/etc/opendkim/mail.private"
  +    opendkim_flags="-c relaxed -h"
  +    opendkim_prolog="true"
  +    opendkim_epilog="true"
  +    opendkim_numfiles="10"
  +    opendkim_minsize="1M"
  +    opendkim_complevel="9"
  +
  +%common
  +    opendkim_cfgfile="@l_prefix@/etc/opendkim/opendkim.conf"
  +    opendkim_tmpdir="@l_prefix@/var/opendkim/opendkim.tmp"
  +    opendkim_pidfile="@l_prefix@/var/opendkim/opendkim.pid"
  +    opendkim_logfile="@l_prefix@/var/opendkim/opendkim.log"
  +    opendkim_socket="@l_prefix@/var/milter/socket/opendkim"
  +    opendkim_signal () {
  +        [ -f $opendkim_pidfile ] && kill -$1 `cat $opendkim_pidfile`
  +    }
  +
  +%status -u @l_susr@ -o
  +    opendkim_usable="unknown"
  +    opendkim_active="no"
  +    rcService opendkim enable yes && \
  +        opendkim_signal 0 && opendkim_active="yes"
  +    echo "opendkim_enable=\"$opendkim_enable\""
  +    echo "opendkim_usable=\"$opendkim_usable\""
  +    echo "opendkim_active=\"$opendkim_active\""
  +
  +%start -u @l_susr@
  +    rcService opendkim enable yes || exit 0
  +    rcService opendkim active yes && exit 0
  +    cmd="@l_prefix@/sbin/opendkim"
  +    cmd="$cmd -l -u @l_rusr@"
  +    cmd="$cmd -p local:$opendkim_socket"
  +    cmd="$cmd -P $opendkim_pidfile"
  +    if [ ".$opendkim_selector" != . ]; then
  +        cmd="$cmd -s \"$opendkim_selector\""
  +    fi
  +    if [ ".$opendkim_domain" != . ]; then
  +        cmd="$cmd -d \"$opendkim_domain\""
  +    fi
  +    if [ ".$opendkim_keyfile" != . ]; then
  +        cmd="$cmd -k \"$opendkim_keyfile\""
  +    fi
  +    cmd="$cmd -x \"$opendkim_cfgfile\""
  +    cmd="$cmd $opendkim_flags"
  +    ( umask 002
  +      export DKIM_TMPDIR="$opendkim_tmpdir"
  +      rm -f $opendkim_socket >/dev/null 2>&1 || true
  +      eval $cmd
  +    ) || exit $?
  +
  +%stop -u @l_susr@
  +    rcService opendkim enable yes || exit 0
  +    rcService opendkim active no  && exit 0
  +    opendkim_signal TERM
  +    sleep 2
  +    rm -f $opendkim_pidfile >/dev/null 2>&1 || true
  +    rm -f $opendkim_socket  >/dev/null 2>&1 || true
  +
  +%restart -u @l_susr@
  +    rcService opendkim enable yes || exit 0
  +    rcService opendkim active no  && exit 0
  +    rc opendkim stop start
  +
  +%daily -u @l_susr@
  +    rcService opendkim enable yes || exit 0
  +    shtool rotate -f \
  +        -n $opendkim_numfiles -s $opendkim_minsize -d \
  +        -z $opendkim_complevel -m 644 -o @l_rusr@ -g @l_rgrp@ \
  +        -P "$opendkim_prolog" \
  +        -E "$opendkim_epilog; rc opendkim restart" \
  +        $opendkim_logfile
  +
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to