# $Id$ PNAME="dovecot" PVER="1.2.10" PBUILD="r2" PCATEGORIE="net-mail" STATE="unstable" DESCRIPTION="Dovecot is an IMAP and POP3 server written with security primarily in mind." HOMEPAGE="http://dovecot.org/" DEPEND=">= net-mail/mail-base-files-0.1 >= sys-libs/pam-1.1 >= sys-libs/libcap-2.17 >= dev-libs/openssl-0.9.8k >= net-nds/openldap-2.4 >= dev-db/mysql5-5.1 >= dev-db/sqlite-3.6 >= dev-db/db-4.8" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" RC_CVS_REV=1.2 sminclude mtools SRC_URI=( http://dovecot.org/releases/${PVER%.*}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/dovecot.rc-${RC_CVS_REV} mirror://${PNAME}/${PNAME}-${PVER}-magellan-defaults.patch mirror://${PNAME}/${PNAME}-${PVER}-config-install.patch ) UP2DATE="updatecmd ${HOMEPAGE}/download.html | grep -A3 'Stable' | grep 'Download' | sed 's:.*v\(.*\)\ sources.*:\1:'" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # apply our default settings mpatch ${PNAME}-${PVER}-magellan-defaults.patch || die # install only devcot.conf and not any examples to /etc/dovecot mpatch ${PNAME}-${PVER}-config-install.patch || die } src_compile() { cd ${SRCDIR} mconfigure \ --sysconfdir=/etc/dovecot \ --with-moduledir=/usr/$(mlibdir)/dovecot \ --localstatedir=/var \ --enable-header-install \ --enable-ipv6 \ --disable-debug \ --with-ioloop=best \ --with-poll=best \ --with-libcap \ --with-ssl=openssl \ --with-ssldir=/etc/ssl \ --with-ldap=plugin \ --with-sql=plugin \ --with-sql-drivers \ --with-mysql \ --with-sqlite \ --with-db \ --with-pam \ || die mmake || die } src_install() { cd ${SRCDIR} mmake DESTDIR=${BINDIR} install || die # we're using pam files (imap and pop3) provided by mailbase sed -i '/passdb pam/, /^[ \t]*}/ s|#args = dovecot|args = "\*"|' \ ${BINDIR}/etc/dovecot/dovecot.conf || die # install our initscript minstallrc dovecot.rc-${RC_CVS_REV} dovecot || die # remove unwanted docs rm -rf ${BINDIR}/usr/share/doc/dovecot || die minstalldocs AUTHORS ChangeLog COPYING* NEWS README TODO || die minstalldocs dovecot-example.conf || die } preinstall() { # adding proftpd user ${MLIBDIR}/mgroupadd -o "-g 97" dovecot ${MLIBDIR}/museradd -o "-u 97 -g dovecot -d /dev/null -s /bin/false" dovecot } postinstall() { # generate a self-signed ssl-cert if [[ ! -f /etc/ssl/certs/dovecot.pem ]] then /usr/sbin/openssl-make-certs dovecot fi # rebuild ssl-parametes if [[ ! -f /var/run/dovecot/login/ssl-parameters.dat ]] then dovecot --build-ssl-parameters &> /dev/null fi mstartservice dovecot } postremove() { mstopservice dovecot }