#!/bin/sh ############################# ## Build script for: postfix ## Creator: jmedina@tuxjm.net ## Date: 03 Jan 05 ## Builds package: Yes ## Source location: http://www.postfix.org ## Build script version: 1 ## Requirements: None ## ## Notes: Any special notes the person may need to edit this file. ## # Set initial variables CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=/tmp/package-postfix NAME=postfix VERSION=2.2.1 ARCH=${ARCH:-i486} BUILD=1jm if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mcpu=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf ${NAME}-${VERSION} tar xvzf $CWD/${NAME}-${VERSION}.tar.gz cd ${NAME}-${VERSION} chown -R root.root . find . -perm 444 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; CFLAGS=${SLKCFLAGS} make makefiles CC="gcc" OPT="${CFLAGS}" \ CCARGS="-DHAS_PCRE -DUSE_TLS -DUSE_SASL_AUTH -I/usr/include/sasl" \ AUXLIBS="-L/usr/lib -lpcre -ldl -lcrypt -lpthread -lssl -lcrypto -lsasl2" make /bin/sh postfix-install \ -non-interactive \ install_root="${PKG}" \ config_directory="/etc/postfix" \ daemon_directory="/usr/libexec/postfix" \ command_directory="/usr/sbin" \ html_directory="/usr/doc/${NAME}-${VERSION}/html" \ queue_directory="/var/spool/postfix" \ sendmail_path="/usr/sbin/sendmail.postfix" \ newaliases_path="/usr/bin/newaliases.postfix" \ mailq_path="/usr/bin/mailq.postfix" \ mail_owner="postfix" \ setgid_group="postdrop" \ manpage_directory="/usr/man" \ sample_directory="/usr/doc/${NAME}-${VERSION}/samples" \ readme_directory="/usr/doc/${NAME}-${VERSION}/readme" install -c auxiliary/rmail/rmail ${PKG}/usr/bin/rmail install -c auxiliary/qshape/qshape.pl ${PKG}/usr/bin/qshape.pl # Change alias_maps and alias_database default directory to /etc/postfix bin/postconf -c ${PKG}/etc/postfix -e \ "alias_maps = hash:/etc/postfix/aliases" \ "alias_database = hash:/etc/postfix/aliases" touch ${PKG}/etc/postfix/aliases.db # Move stuff around so we don't conflict with sendmail mv ${PKG}/usr/bin/rmail ${PKG}/usr/bin/rmail.postfix mv ${PKG}/usr/man/man1/mailq.1 ${PKG}/usr/man//man1/mailq.postfix.1 mv ${PKG}/usr/man/man1/newaliases.1 ${PKG}/usr/man/man1/newaliases.postfix.1 mv ${PKG}/usr/man/man5/aliases.5 ${PKG}/usr/man/man5/aliases.postfix.5 gzip -9 $PKG/usr/man/man?/*.? mkdir -p $PKG/usr/doc/${NAME}-${VERSION} cp -a \ COMPATIBILITY COPYRIGHT HISTORY \ IPv6-ChangeLog LICENSE PORTING RELEASE_NOTES* \ TLS_* \ $PKG/usr/doc/${NAME}-${VERSION} ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh # Build the package: cd $PKG makepkg -l y -c n ${TMP}/${NAME}-${VERSION}-${ARCH}-${BUILD}.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf ${TMP}/${NAME}-${VERSION} rm -rf $PKG fi