diff options
author | mario <mario@slackverse.org> | 2010-10-19 20:09:25 +0100 |
---|---|---|
committer | Michiel van Wessem <michiel@slackbuilds.org> | 2010-10-19 20:09:25 +0100 |
commit | b385046138ba68d222573585879492193726affb (patch) | |
tree | 2e16f2bcd2010a6e3c68254195a5c0129c820872 | |
parent | 31444f01c3a08fe385d86afa5de85622d2089ac9 (diff) | |
download | slackbuilds-b385046138ba68d222573585879492193726affb.tar.gz |
network/cyrus-imapd: Added. (scalable enterprise mail system).
Signed-off-by: Michiel van Wessem <michiel@slackbuilds.org>
-rw-r--r-- | network/cyrus-imapd/README | 29 | ||||
-rw-r--r-- | network/cyrus-imapd/README.SLACKWARE | 17 | ||||
-rw-r--r-- | network/cyrus-imapd/cyrus-imapd.SlackBuild | 150 | ||||
-rw-r--r-- | network/cyrus-imapd/cyrus-imapd.info | 10 | ||||
-rw-r--r-- | network/cyrus-imapd/doinst.sh | 27 | ||||
-rw-r--r-- | network/cyrus-imapd/imapd.conf | 5 | ||||
-rw-r--r-- | network/cyrus-imapd/rc.cyrus-imapd | 43 | ||||
-rw-r--r-- | network/cyrus-imapd/slack-desc | 19 |
8 files changed, 300 insertions, 0 deletions
diff --git a/network/cyrus-imapd/README b/network/cyrus-imapd/README new file mode 100644 index 0000000000..718fbb8dd2 --- /dev/null +++ b/network/cyrus-imapd/README @@ -0,0 +1,29 @@ +What is IMAP? + +The Cyrus IMAP (Internet Message Access Protocol) server provides access to +personal mail and system-wide bulletin boards through the IMAP protocol. +The Cyrus IMAP server is a scalable enterprise mail system designed for use +from small to large enterprise environments using standards-based +technologies. + +A full Cyrus IMAP implementation allows a seamless mail and bulletin board +environment to be set up across multiple servers. It differs from other IMAP +server implementations in that it is run on "sealed" servers, where users +are not normally 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 software using the IMAP, POP3, or KPOP protocols. + +The private mailbox database design gives the server large advantages in +efficiency, scalability, and administratability. Multiple concurrent +read/write connections to the same mailbox are permitted. The server +supports access control lists on mailboxes and storage quotas on mailbox +hierarchies. + +Cyrus is a highly scalable enterprise mail system designed for use in +enterprise environments of various sizes using standards based technologies. +Cyrus technologies scale from independent use in email departments to a system +centrally managed in a large enterprise. + +For more information on how to install and run cyrus-imapd, see +README.SLACKWARE that came with this package (which is also installed with the +docs). diff --git a/network/cyrus-imapd/README.SLACKWARE b/network/cyrus-imapd/README.SLACKWARE new file mode 100644 index 0000000000..6866435185 --- /dev/null +++ b/network/cyrus-imapd/README.SLACKWARE @@ -0,0 +1,17 @@ +Here are some tips about getting cyrus-imapd up and running. +Since a sample configuration included with this package requires +a specific directory structure, you can do something like this: + +# mkdir -m 750 -p /var/imap /var/spool/imap /var/sieve +# chown cyrus:cyrus /var/imap /var/spool/imap /var/sieve + +Afterwards run mkimap script to setup the enviroment: + +# su - cyrus +# /usr/doc/cyrus-imapd-2.3.16/tools/mkimap + +You will probably also want to put this into rc.local: + +if [ -x /etc/rc.d/rc.cyrus-imapd ]; then + . /etc/rc.d/rc.cyrus-imapd start +fi diff --git a/network/cyrus-imapd/cyrus-imapd.SlackBuild b/network/cyrus-imapd/cyrus-imapd.SlackBuild new file mode 100644 index 0000000000..710e0f4ea4 --- /dev/null +++ b/network/cyrus-imapd/cyrus-imapd.SlackBuild @@ -0,0 +1,150 @@ +#!/bin/sh + +# Slackware build script for cyrus-imapd + +# Copyright 2010, mario <mario@slackverse.org> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS 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 AUTHOR 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. + +PRGNAM=cyrus-imapd +VERSION=${VERSION:-2.3.16} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +# Bail if user isn't valid on your system +if ! grep -q ^cyrus: /etc/passwd ; then + echo " You must have a cyrus user to run this script." + echo " # groupadd -g 238 cyrus" + echo " # useradd -d /var/imap -s /bin/sh -u 238 -g 238 cyrus" + echo " Or something similar." + exit 1 +fi + +# Build with mysql database by default, sqlite/mysql/postgresql are supported +DATABASE=${DATABASE:-mysql} +case "$DATABASE" in + pgsql) DATABASE="--with-pgsql --with-mysql-incdir=/usr/include/pgsql" ;; + mysql) DATABASE="--with-mysql --with-mysql-incdir=/usr/include/mysql" ;; + sqlite) DATABASE="--with-sqlite" ;; + *) DATABASE="" ;; +esac + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --with-service-path=/usr/libexec/cyrus \ + --with-sasl \ + --with-libwrap \ + --with-openssl \ + --with-perl \ + --with-bdb-incdir=/usr/include/db4 \ + --with-cyrus-user=cyrus \ + --with-cyrus-group=cyrus \ + $DATABASE \ + --build=$ARCH-slackware-linux + +make PERL_MM_OPT='INSTALLDIRS=vendor' +make install DESTDIR=$PKG + +# Move incorrectly installed man pages +mv $PKG/usr/share/man $PKG/usr/ && rmdir $PKG/usr/share || true + +# Copy init script +install -D -m0755 -oroot -groot $CWD/rc.cyrus-imapd $PKG/etc/rc.d/rc.cyrus-imapd.new + +# Install sample configuration +install -D -m0640 -ocyrus -gcyrus master/conf/normal.conf $PKG/etc/cyrus.conf.new +install -D -m0640 -ocyrus -gcyrus $CWD/imapd.conf $PKG/etc/imapd.conf.new + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +find $PKG -name perllocal.pod \ + -o -name ".packlist" \ + -o -name "*.bs" \ + | xargs rm -f + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYRIGHT README README.andrew doc/ master/conf tools/ $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE + +# Clean up the obsolete /usr/lib on 64bit systems. +if [ "$ARCH" = "x86_64" ]; then + rmdir $PKG/usr/lib +fi + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/cyrus-imapd/cyrus-imapd.info b/network/cyrus-imapd/cyrus-imapd.info new file mode 100644 index 0000000000..64fad2a40a --- /dev/null +++ b/network/cyrus-imapd/cyrus-imapd.info @@ -0,0 +1,10 @@ +PRGNAM="cyrus-imapd" +VERSION="2.3.16" +HOMEPAGE="http://www.cyrusimap.org/" +DOWNLOAD="ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-2.3.16.tar.gz" +MD5SUM="6a37feb1985974eee8a4a4b2932dd54c" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="mario" +EMAIL="mario@slackverse.org" +APPROVED="michiel" diff --git a/network/cyrus-imapd/doinst.sh b/network/cyrus-imapd/doinst.sh new file mode 100644 index 0000000000..ec38d4e521 --- /dev/null +++ b/network/cyrus-imapd/doinst.sh @@ -0,0 +1,27 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.cyrus-imapd.new +config etc/cyrus.conf.new +config etc/imapd.conf.new diff --git a/network/cyrus-imapd/imapd.conf b/network/cyrus-imapd/imapd.conf new file mode 100644 index 0000000000..ab399bf8de --- /dev/null +++ b/network/cyrus-imapd/imapd.conf @@ -0,0 +1,5 @@ +configdirectory: /var/imap +partition-default: /var/spool/imap +sievedir: /var/sieve +admins: cyrus +sasl_pwcheck_method: saslauthd diff --git a/network/cyrus-imapd/rc.cyrus-imapd b/network/cyrus-imapd/rc.cyrus-imapd new file mode 100644 index 0000000000..c148183bbf --- /dev/null +++ b/network/cyrus-imapd/rc.cyrus-imapd @@ -0,0 +1,43 @@ +#!/bin/sh +# Start/stop/restart the Cyrus IMAP daemon. +# Written by mario <mario@slackverse.org>. + +cyrus_start() { + if [ -x /usr/libexec/cyrus/master ]; then + if [ -f /var/run/cyrus-master.pid ] && kill -0 $(cat /var/run/cyrus-master.pid) 2> /dev/null; then + echo "Cyrus IMAP daemon already running." + return + fi + echo "Starting Cyrus IMAP daemon: /usr/libexec/cyrus/master" + /usr/libexec/cyrus/master -d + fi +} + +cyrus_stop() { + if [ -f /var/run/cyrus-master.pid ]; then + echo "Stopping Cyrus IMAP daemon" + kill $(cat /var/run/cyrus-master.pid) 2> /dev/null && rm -f /var/run/cyrus-master.pid + else + echo "Cyrus IMAP daemon already stopped." + fi +} + +cyrus_restart() { + cyrus_stop + sleep 1 + cyrus_start +} + +case "$1" in + start) + cyrus_start + ;; + stop) + cyrus_stop + ;; + restart) + cyrus_restart + ;; + *) + echo "usage $0 start|stop|restart" +esac diff --git a/network/cyrus-imapd/slack-desc b/network/cyrus-imapd/slack-desc new file mode 100644 index 0000000000..9a96be1c44 --- /dev/null +++ b/network/cyrus-imapd/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +cyrus-imapd: cyrus-imapd (scalable enterprise mail system) +cyrus-imapd: +cyrus-imapd: The Cyrus IMAP (Internet Message Access Protocol) server provides +cyrus-imapd: access to personal mail and system-wide bulletin boards through the +cyrus-imapd: IMAP protocol. +cyrus-imapd: The Cyrus IMAP server is a scalable enterprise mail system designed +cyrus-imapd: for use from small to large enterprise environments using +cyrus-imapd: standards-based technologies. +cyrus-imapd: +cyrus-imapd: Homepage: http://www.cyrusimap.org/ +cyrus-imapd: |