[dovecot] Re: dovecot RPM for Red Hat Linux

Farkas Levente lfarkas at bnap.hu
Mon Apr 14 12:14:37 EEST 2003


here is what we use to compile the cvs.

Warren Togami wrote:
> On Sun, 2003-04-13 at 15:42, Warren Togami wrote:
> 
>>http://bugzilla.fedora.us/show_bug.cgi?id=160
>>
>>This .src.rpm is dovecot with RH-specific default settings.  I modified
>>Jeremy Katz' dovecot-0.99.8.1 package a bit.
> 
> 
> I ran into and fixed a few packaging problems listed below, but the last
> two I'm not exactly sure how to fix.  Any suggestions?
> 
> One problem within /etc/init.d/dovecot
> ======================================
> start() {
>         # Check if pxe is already running
>         if [ ! -f /var/lock/subsys/dovecot ]; then
>             echo -n $"Starting $prog: "
>             /usr/sbin/dovecot &
>             [ -n "`pidofproc /usr/sbin/dovecot`" ] && success
>             RETVAL=$?
>             [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
>             echo
>         fi
> }
> 
> This line "/usr/sbin/dovecot &" executes in the background, but the next line "[
> -n "`pidofproc /usr/sbin/dovecot`" ] && success" happens too soon, causing a non
> zero return value and a FAILED message during bootup.  I confirmed this by
> adding "sleep 5" between the two lines, giving it enough time to startup
> completely before testing for the pid.  It no displays the fake FAILED message
> during bootup.  What should be the proper fix for this?
> 
> RH init script problem
> ======================
> Another problem happens during RH's init scripts after you reboot.  By default
> dovecot uses /var/run/dovecot/login/ as a directory to create unix sockets for
> login.  RH's init script displays an error messages when I tries to remove
> /var/run/*/* files because it is a directory, not a file.  I changed dovecot's
> default to /var/run/dovecot and it now avoids this error.
> 
> chkconfig problem
> =================
> [root at goku log]# chkconfig --list |grep dovecot
> dovecot         0:off   1:off   2:off   3:off   4:off   5:off   6:off
> [root at goku log]# chkconfig dovecot on
> [root at goku log]# chkconfig --list |grep dovecot
> dovecot         0:off   1:off   2:off   3:off   4:off   5:off   6:off
> The init.d and rc.d stuff seems to have problems, I haven't analyzed this yet.
> 
> Service name problem
> ====================
> During startup it says "5dovecot: Starting Dovecot Imap:"
> I'm not sure why it says "5dovecot" rather than "dovecot".  Any ideas?
> 
> Warren Togami
> warren at togami.com
> 
> 
> 
> 


-- 
   Levente                               "Si vis pacem para bellum!"
-------------- next part --------------
--- dovecot-0.99.8.1/doc/Makefile.in.lfarkas	2003-02-28 15:04:45.000000000 +0100
+++ dovecot-0.99.8.1/doc/Makefile.in	2003-02-28 15:05:46.000000000 +0100
@@ -82,7 +82,7 @@
 VPOPMAIL_LIBS = @VPOPMAIL_LIBS@
 ssldir = @ssldir@
 
-docdir = $(datadir)/doc/dovecot
+docdir = $(datadir)/doc/dovecot-0.99.8.1
 
 doc_DATA =  	auth.txt 	configuration.txt 	design.txt 	index.txt 	mail-storages.txt 	multiaccess.txt 	nfs.txt
 
-------------- next part --------------
--- dovecot-1.0/configure.lfarkas	2003-03-20 15:53:04.000000000 +0100
+++ dovecot-1.0/configure	2003-03-20 15:54:37.000000000 +0100
@@ -8205,7 +8205,7 @@
 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
 
 # Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+LIBTOOL='$(SHELL) libtool'
 
 # Prevent multiple expansion
 
-------------- next part --------------
#!/bin/bash
#
#	/etc/rc.d/init.d/dovecot
#
# Starts the dovecot daemon
#
# chkconfig: - 345 54 54
# description: Dovecot Imap Server
# processname: dovecot
# Source function library.
. /etc/init.d/functions

test -x /usr/sbin/dovecot || exit 0

RETVAL=0
prog="dovecot"

start() {
	echo -n $"Starting $prog: "
	# Check if dovecot is already running
	if [ ! -f /var/lock/subsys/dovecot ]; then
	    daemon /usr/sbin/dovecot
	    RETVAL=$?
	    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
	    echo
	else
	    failure $"dovecot start"
	    echo
	fi
	return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc dovecot
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dovecot
	echo
	return $RETVAL
}

#
#	See how we were called.
#
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  reload|restart)
	stop
	start
	;;
  condrestart)
	if [ -f /var/lock/subsys/dovecot ]; then
	    stop
	    start
	fi
	;;
  status)
	status /usr/sbin/dovecot
	;;
  *)
	echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
	exit 1
esac

exit $?
-------------- next part --------------
#%PAM-1.0
#
# $Id: system-auth.authpam,v 1.1 2001/02/02 05:42:57 mrsam Exp $
#
# Copyright 1998-2001 Double Precision, Inc.  See COPYING for
# distribution information.
#
# This is a sample authpam configuration file that uses pam_stack
# (circa linux-pam 0.72).

auth       required     pam_nologin.so
auth       required     pam_stack.so service=system-auth
account    required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth
-------------- next part --------------
%define uid 96
%define gid 96

Summary: Dovecot Secure imap server
Name: dovecot
Version: 1.0
Release: cvs
License: GPL
Group: System Environment/Daemons
Source: %{name}-%{version}.tar.gz
Source2: dovecot.init
Source3: dovecot.pam
Patch: dovecot-libtool.patch
URL: http://dovecot.procontrol.fi/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
Dovecot IMAP server - compiled with openssl, pam and ldap support certs in /etc/ssl

%prep

%setup -q
%patch -p1

%build
#./autogen.sh
%configure --with-ldap --with-ssl=openssl --with-rawlog

make

%install
rm -rf $RPM_BUILD_ROOT
%makeinstall
rm -rf $RPM_BUILD_ROOT/%{_datadir}/%{name}
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/%{name}
mv $RPM_BUILD_ROOT/%{_sysconfdir}/dovecot-example.conf $RPM_BUILD_ROOT/%{_sysconfdir}/dovecot.conf
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/dovecot
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/imap
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/imaps
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/pop3
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/pop3s

%post
/sbin/chkconfig --add dovecot

# Add the dovecot user and group if not found
groupadd -g %{gid} -r dovecot 2>/dev/null || :
useradd -d /var/run/dovecot -s /bin/false -g dovecot -M -r -u %{uid} dovecot 2>/dev/null || :

%preun
/sbin/chkconfig --del dovecot

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%config %{_sysconfdir}/dovecot.conf
%config %{_sysconfdir}/pam.d/*
%config %{_sysconfdir}/rc.d/init.d/dovecot
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/*
%dir %{_sbindir}
%{_sbindir}/*
%doc doc/*.txt doc/dovecot-* doc/mkcert.sh INSTALL AUTHORS ChangeLog COPYING TODO README NEWS COPYING.LGPL

%changelog
* Mon Mar 24 2003 Levente Farkas <lfarkas at lfarkas.org>
- update a few things for the current cvs

* Sun Feb 28 2003 Zalavary Gabor <zgabor at bnap.hu>
- 0.99.8 rebuild:)

* Sun Dec  1 2002 Seth Vidal <skvidal at phy.duke.edu>
- 0.99.4 and fix startup so it starts imap-master not vsftpd :)

* Tue Nov 26 2002 Seth Vidal <skvidal at phy.duke.edu>
- first build


More information about the dovecot mailing list