#!/bin/bash # # dovecot.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # dovecot.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="dovecot" PACKAGE_EXT="gz" VERSION=${VERSION:=2.3.9.1} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="http://dovecot.org/releases/$(echo ${VERSION} | cut -f 1,2 -d .)/$SRC" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # Ship config set up for authentication from /etc/passwd and /etc/shadow. zcat $CWD/dovecot.default.shadow.auth.diff.gz | patch -p1 --verbose || exit 1 # Since this package installs working config files in /etc/dovecot, there isn't # any need to send people to /usr/doc. Also, make sure that TLS is recommended. zcat $CWD/dovecot.config.README.diff.gz | patch -p1 --verbose || exit 1 CFLAGS="$SLKCFLAGS" ./configure \ --prefix=/usr \ --libdir=${LIBDIR} \ --sysconfdir=/etc \ --localstatedir=/var \ --enable-static=no \ --enable-shared=yes \ --with-pam=no \ --with-ldap=plugin \ --with-lucene \ --with-sqlite \ --with-libcap \ --with-sql=plugin \ --with-mysql \ --with-zlib \ --with-bzlib \ --build=$ARCH-slackware-linux || exit 1 make $NUMJOBS || exit 2 make DESTDIR=$PKG install mkdir -p $DOCS/openssl cp -a AUTHORS COPYING* ChangeLog INSTALL* NEWS README* TODO $DOCS cp -p doc/dovecot-openssl.cnf doc/mkcert.sh $DOCS/openssl # Fix up package: ( cd $DOCS mv $PKG/usr/share/doc/dovecot . rm -rf $PKG/usr/share ) mkdir -p $PKG/usr/man/man1 $PKG/usr/man/man7 cp doc/man/*.1 $PKG/usr/man/man1 cp doc/man/*.7 $PKG/usr/man/man7 # SysV init mkdir -p $PKG/etc/rc.d/init.d $PKG/var/log/setup install -m 755 $CWD/dovecot.init $PKG/etc/rc.d/init.d/dovecot install -m 755 $CWD/setup.dovecot $PKG/var/log/setup # Fix README sed -i "s|\/share\/doc|\/doc\/dovecot-${VERSION}|" $PKG/etc/dovecot/README fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi