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

  Server: cvs.openpkg.org                  Name:   Michael Schloh
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   05-Sep-2002 08:40:15
  Branch: HEAD                             Handle: 2002090507401500

  Added files:
    openpkg-src/imapd       imapd.conf rc.imapd
  Modified files:
    openpkg-src/imapd       imapd.spec

  Log:
    Add essential configuration and run command code, and bring imapd back to
    life.

  Summary:
    Revision    Changes     Path
    1.1         +20 -0      openpkg-src/imapd/imapd.conf
    1.35        +48 -6      openpkg-src/imapd/imapd.spec
    1.1         +36 -0      openpkg-src/imapd/rc.imapd
  ____________________________________________________________________________

  Index: openpkg-src/imapd/imapd.conf
  ============================================================
  $ cvs update -p -r1.1 imapd.conf
  ##
  ##  imapd.conf -- IMAP daemon configuration
  ##  Copyright (c) 2002 Ralf S. Engelschall <[EMAIL PROTECTED]>
  ##
  
  configdirectory:        @l_prefix@/var/imapd
  partition-default:      @l_prefix@/var/spool/imap
  admins:                 @l_musr@
  sasl_pwcheck_method:    saslauthd
  sendmail:               @l_prefix@/sbin/sendmail
  #unixhierarchysep:       yes
  #altnamespace:           yes
  allowanonymouslogin:    no
  allowplaintext:         yes
  servername:             my.imap.server
  autocreatequota:        10000
  reject8bit:             no
  quotawarn:              90
  timeout:                30
  
  Index: openpkg-src/imapd/imapd.spec
  ============================================================
  $ cvs diff -u -r1.34 -r1.35 imapd.spec
  --- openpkg-src/imapd/imapd.spec      31 Aug 2002 09:30:51 -0000      1.34
  +++ openpkg-src/imapd/imapd.spec      5 Sep 2002 06:40:15 -0000       1.35
  @@ -32,23 +32,31 @@
   Group:        Mail
   License:      BSD
   Version:      2.1.9
  -Release:      20020831
  +Release:      20020905
   
   #   list of sources
   Source0:      ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-%{version}.tar.gz
  +Source1:      imapd.conf
  +Source2:      rc.imapd
   Patch0:       imapd.patch
   
   #   build information
   Prefix:       %{l_prefix}
   BuildRoot:    %{l_buildroot}
  -BuildPreReq:  OpenPKG, openpkg >= 20020206, sasl, db3, openssl, make
  -PreReq:       OpenPKG, openpkg >= 20020206, sasl, db3, MTA, openssl
  +BuildPreReq:  OpenPKG, openpkg >= 20020206, sasl, db3, openssl, make, perl
  +PreReq:       OpenPKG, openpkg >= 20020206, sasl, db3, openssl, MTA
   AutoReq:      no
   AutoReqProv:  no
   Provides:     IMAP
   
   %description
  -    Cyrus IMAP Server is an IMAP4 and POP3 daemon.
  +
  +    The Cyrus IMAP server is an IMAP4 and POP3 daemon that differs from
  +    other IMAP server implementations in that it is generally intended to
  +    be run on sealed servers, where normal users are not permitted to log
  +    in. The mailbox database is stored in parts of the filesystem that are
  +    private to the Cyrus IMAP system. All user access to mail is through
  +    the IMAP, POP3, or KPOP protocols.
   
   %prep
       %setup -q -n cyrus-imapd-%{version}
  @@ -76,6 +84,10 @@
           --with-cyrus-prefix=%{l_prefix} \
           --with-cyrus-user=%{l_musr} \
           --with-cyrus-group=%{l_mgrp}
  +
  +    #   redirect the hard coded file paths
  +    %{l_shtool} subst -e "s;/etc/\(.*\).conf;%{l_prefix}/etc/imapd/\\1.conf;" \
  +        imap/*.c imap/*.h master/*.c master/*.h
       %{l_make} %{l_mflags}
   
   %install
  @@ -85,8 +97,38 @@
           exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
           cyrus_prefix=$RPM_BUILD_ROOT%{l_prefix}
       %{l_shtool} mkdir -f -p -m 755 \
  -        $RPM_BUILD_ROOT%{l_prefix}/var/imapd
  -    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/imapd \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/imapd \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/spool
  +
  +    #   offer a sane configuration
  +    cp master/conf/small.conf master/conf/cyrus.conf
  +    %{l_shtool} subst -e "s;/var/imap/socket;%{l_prefix}/var/imapd/socket;g" \
  +        master/conf/cyrus.conf
  +    %{l_shtool} install -c -m 644 \
  +        -e 's;@l_prefix@;%{l_prefix};g' \
  +        -e 's;@l_musr@;%{l_musr};g' \
  +        %{SOURCE imapd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/ \
  +        master/conf/cyrus.conf $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/
  +
  +    #   install the run command file
  +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  +    %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  +        %{SOURCE rc.imapd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +
  +    #   use mkimap to create many directories for us
  +    cp $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/imapd.conf imapd.conf.hack
  +    %{l_shtool} subst -e "s;%{l_prefix};$RPM_BUILD_ROOT%{l_prefix};" \
  +        imapd.conf.hack
  +    %{l_shtool} subst -e "s;/etc/imapd.conf;imapd.conf.hack;" \
  +        tools/mkimap
  +    tools/mkimap
  +
  +    #   determine files
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  +        %{l_files_std} \
  +        '%config %{l_prefix}/etc/imapd/imapd.conf' \
  +        '%config %{l_prefix}/etc/imapd/cyrus.conf'
   
   %files -f files
   
  Index: openpkg-src/imapd/rc.imapd
  ============================================================
  $ cvs update -p -r1.1 rc.imapd
  #!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
  ##
  ##  rc.imapd -- Run-Commands for IMAP daemon
  ##
  
  %config
      imapd_enable="yes"
  
  %start -p 200 -u root
      if opServiceEnabled imapd; then
          @l_prefix@/bin/master &
      fi
  
  %stop -p 200 -u root
      if opServiceEnabled imapd; then
          if [ -f @l_prefix@/var/imapd/imapd.pid ]; then
              kill -TERM `cat @l_prefix@/var/imapd/imapd.pid`
          fi
      fi
  
  %restart -u root
      if opServiceEnabled imapd; then
          if [ -f @l_prefix@/var/imapd/imapd.pid ]; then
              kill -TERM `cat @l_prefix@/var/imapd/imapd.pid`
              sleep 2
          fi
          @l_prefix@/bin/master &
      fi
  
  %reload -u root
      if opServiceEnabled imapd; then
          if [ -f @l_prefix@/var/imapd/imapd.pid ]; then
              kill -HUP `cat @l_prefix@/var/imapd/imapd.pid`
          fi
      fi
  
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to