diff options
Diffstat (limited to 'extra/postfix')
-rw-r--r-- | extra/postfix/APKBUILD | 56 | ||||
-rw-r--r-- | extra/postfix/postfix.initd | 48 | ||||
-rw-r--r-- | extra/postfix/postfix.install | 13 |
3 files changed, 117 insertions, 0 deletions
diff --git a/extra/postfix/APKBUILD b/extra/postfix/APKBUILD new file mode 100644 index 0000000000..9c135121fe --- /dev/null +++ b/extra/postfix/APKBUILD @@ -0,0 +1,56 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=postfix +pkgver=2.5.6 +pkgrel=0 +pkgdesc="Secure and fast drop-in replacement for Sendmail (MTA)" +url="http://www.postfix.org/" +license="IPL-1" +depends="db pcre openssl" +makedepends="db-dev pcre-dev openssl-dev" +install=postfix.install +subpackages="$pkgname-doc" +source="ftp://ftp.porcupine.org/mirrors/$pkgname-release/official/$pkgname-$pkgver.tar.gz + $pkgname.initd + $install + " + +build () { + cd "$srcdir/$pkgname-$pkgver" + + sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \ + -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/postfix/aliases|" \ + src/util/sys_defs.h || return 1 + sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || return 1 + + make DEBUG="" \ + OPT="$CFLAGS" \ + CCARGS="-DHAS_PCRE -DUSE_TLS -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"" \ + AUXLIBS="$LDFLAGS -lpcre -lcrypt -lpthread -lssl -lcrypto" \ + makefiles || return 1 + make OPT="$CFLAGS" || return 1 + + sh postfix-install \ + -non-interactive \ + install_root="$pkgdir" \ + config_directory=/usr/share/doc/$pkgname/defaults \ + readme_directory=/usr/share/doc/$pkgname/readme \ + manpage_directory=/usr/share/man \ + || return 1 + for i in postdrop postqueue; do + chgrp postdrop "$pkgdir"/usr/sbin/$i + chmod g+s "$pkgdir"/usr/sbin/$i + done + + mkdir -p "$pkgdir"/etc/postfix + mv "$pkgdir"/usr/share/doc/$pkgname/defaults/*.cf \ + "$pkgdir"/usr/share/doc/$pkgname/defaults/post*-* \ + "$pkgdir"/usr/share/doc/$pkgname/defaults/aliases \ + "$pkgdir"/etc/postfix/ || return 1 + + install -d -o postfix -g postfix "$pkgdir"/var/spool/postfix + install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE +} +md5sums="ec2cb63b53f5f36c3ca91da8f3bc9407 postfix-2.5.6.tar.gz +8416354d402f3be288fa98b60af86240 postfix.initd +a62143036f227a7e781b57a97457d180 postfix.install" diff --git a/extra/postfix/postfix.initd b/extra/postfix/postfix.initd new file mode 100644 index 0000000000..b2396b3aea --- /dev/null +++ b/extra/postfix/postfix.initd @@ -0,0 +1,48 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/files/postfix.rc6.2.5,v 1.3 2008/08/18 14:18:40 falco Exp $ + +# If you plan to simultaneously use several Postfix instances, don't forget +# to specify your alternate_config_directories variable in your main main.cf file. +# Then make a symlink from /etc/init.d/postfix to /etc/init.d/postfix.alt, +# prepare your new /etc/postfix.alt environment, and at least change these working paths: +# queue_directory = /var/spool/postfix.alt +# data_directory = /var/lib/postfix.alt + +CONF_DIR="/etc/postfix" +CONF_OPT="${SVCNAME##*.}" +if [ -n ${CONF_OPT} -a ${SVCNAME} != "postfix" ]; then + CONF_DIR="${CONF_DIR}.${CONF_OPT}" +fi + +opts="${opts} reload" + +depend() { + use logger dns ypbind amavisd mysql postgresql antivirus postfix_greylist net saslauthd + if [ "${SVCNAME}" = "postfix" ]; then + provide mta + fi +} + +start() { + ebegin "Starting postfix (${CONF_DIR})" + if [ ! -d ${CONF_DIR} ]; then + eend 1 "${CONF_DIR} does not exist" + return 1 + fi + /usr/sbin/postfix -c ${CONF_DIR} start >/dev/null 2>&1 + eend $? +} + +stop() { + ebegin "Stopping postfix (${CONF_DIR})" + /usr/sbin/postfix -c ${CONF_DIR} stop >/dev/null 2>&1 + eend $? +} + +reload() { + ebegin "Reloading postfix (${CONF_DIR})" + /usr/sbin/postfix -c ${CONF_DIR} reload >/dev/null 2>&1 + eend $? +} diff --git a/extra/postfix/postfix.install b/extra/postfix/postfix.install new file mode 100644 index 0000000000..d2d0813a16 --- /dev/null +++ b/extra/postfix/postfix.install @@ -0,0 +1,13 @@ +#!/bin/sh + +case "$1" in + pre_install) + addgroup postfix 2>/dev/null + addgroup postdrop 2>/dev/null + adduser postfix -h /var/spool/postfix -G postfix,mail 2>/dev/null + ;; + post_install) + chown postfix /var/spool/postfix/* /var/lib/postfix + chgrp postdrop /var/spool/postfix/maildrop /var/spool/postfix/public +esac +exit 0 |