summaryrefslogtreecommitdiff
path: root/testing/postfix
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-05-14 22:37:30 +0000
committerroot <root@rshg047.dnsready.net>2011-05-14 22:37:30 +0000
commite69c538fc7af5a9861c7688dd15913082d978180 (patch)
treef193cf26628a71f1c474227fa6c429713558f0a2 /testing/postfix
parent2c4629f613c001fd29740d0f4c0e497c771a2182 (diff)
Sat May 14 22:37:30 UTC 2011
Diffstat (limited to 'testing/postfix')
-rw-r--r--testing/postfix/PKGBUILD64
-rw-r--r--testing/postfix/aliases.patch18
-rw-r--r--testing/postfix/install35
-rwxr-xr-xtesting/postfix/rc.d37
4 files changed, 154 insertions, 0 deletions
diff --git a/testing/postfix/PKGBUILD b/testing/postfix/PKGBUILD
new file mode 100644
index 000000000..6843a2881
--- /dev/null
+++ b/testing/postfix/PKGBUILD
@@ -0,0 +1,64 @@
+# $Id: PKGBUILD 123813 2011-05-13 12:45:42Z bisson $
+# Contributor: Jeff Brodnax <tullyarcher@bellsouth.net>
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+# Maintainer: Paul Mattal <paul@archlinux.org>
+
+pkgname=postfix
+pkgver=2.8.3
+pkgrel=2
+pkgdesc='Secure, fast, easy to administer drop in replacement for Sendmail (MTA)'
+url='http://www.postfix.org/'
+arch=('i686' 'x86_64')
+license=('custom')
+depends=('pcre' 'libsasl' 'libmysqlclient' 'postgresql-libs' 'sqlite3' 'libldap' 'db')
+backup=('etc/postfix/'{access,aliases,canonical,generic,header_checks,main.cf,master.cf,relocated,transport,virtual})
+source=("ftp://ftp.porcupine.org/mirrors/postfix-release/official/${pkgname}-${pkgver}.tar.gz" \
+ 'aliases.patch' \
+ 'rc.d')
+sha1sums=('2604066f158f5327449960afd6334b996dc01799'
+ '5fc3de6c7df1e5851a0a379e825148868808318b'
+ '050e6afc5886049682c945ce147b3c47fe113939')
+
+provides=('smtp-server' 'smtp-forwarder')
+replaces=('postfix-mysql' 'postfix-pgsql')
+conflicts=('postfix-mysql' 'postfix-pgsql' 'smtp-server' 'smtp-forwarder')
+
+install=install
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make makefiles DEBUG='' CCARGS=' \
+ -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl \
+ -DHAS_LDAP \
+ -DUSE_TLS \
+ -DHAS_MYSQL -I/usr/include/mysql \
+ -DHAS_PGSQL -I/usr/include/postgresql \
+ -DHAS_SQLITE \
+ ' AUXLIBS=' \
+ -lsasl2 \
+ -lldap -llber \
+ -lssl -lcrypto \
+ -lmysqlclient -lz -lm \
+ -lpq \
+ -lsqlite3 -lpthread \
+ ' OPT="${CFLAGS} ${LDFLAGS}"
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ sh postfix-install -non-interactive \
+ install_root="${pkgdir}" \
+ daemon_directory="/usr/lib/${pkgname}" \
+ sample_directory="/etc/${pkgname}/sample" \
+ manpage_directory="/usr/share/man"
+
+ install -D -m755 ../rc.d "${pkgdir}/etc/rc.d/${pkgname}"
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+
+ cd "${pkgdir}"
+ patch -p0 < "${srcdir}"/aliases.patch
+}
diff --git a/testing/postfix/aliases.patch b/testing/postfix/aliases.patch
new file mode 100644
index 000000000..6767870b7
--- /dev/null
+++ b/testing/postfix/aliases.patch
@@ -0,0 +1,18 @@
+--- etc/postfix/main.cf.orig 2010-12-13 20:18:22.000000000 +0100
++++ etc/postfix/main.cf 2010-12-13 20:18:24.000000000 +0100
+@@ -382,6 +382,7 @@
+ #alias_maps = hash:/etc/aliases
+ #alias_maps = hash:/etc/aliases, nis:mail.aliases
+ #alias_maps = netinfo:/aliases
++alias_maps = hash:/etc/postfix/aliases
+
+ # The alias_database parameter specifies the alias database(s) that
+ # are built with "newaliases" or "sendmail -bi". This is a separate
+@@ -392,6 +393,7 @@
+ #alias_database = dbm:/etc/mail/aliases
+ #alias_database = hash:/etc/aliases
+ #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
++alias_database = $alias_maps
+
+ # ADDRESS EXTENSIONS (e.g., user+foo)
+ #
diff --git a/testing/postfix/install b/testing/postfix/install
new file mode 100644
index 000000000..f5d81a565
--- /dev/null
+++ b/testing/postfix/install
@@ -0,0 +1,35 @@
+post_install() {
+ getent group postdrop &>/dev/null || groupadd -g 75 postdrop >/dev/null
+ getent group postfix &>/dev/null || groupadd -g 73 postfix >/dev/null
+ getent passwd postfix &>/dev/null || useradd -u 73 -d /var/spool/postfix -g postfix -s /bin/false postfix >/dev/null
+
+ cd var/spool/postfix
+ chown postfix active bounce corrupt defer deferred flush hold incoming private public maildrop trace saved
+ chgrp postdrop public maildrop
+ cd ../../../usr/sbin
+ chgrp postdrop postqueue postdrop
+ chmod g+s postqueue postdrop
+ cd ../..
+ chown postfix var/lib/postfix
+
+ newaliases
+}
+
+post_upgrade() {
+ post_install
+
+ if [ `vercmp $2 2.8` = -1 ]; then cat <<EOF
+
+==> You must now execute "/etc/rc.d/postfix reload" (or restart).
+==> This is needed because the queue manager to delivery agent
+==> protocol has changed.
+
+EOF
+ fi
+}
+
+pre_remove() {
+ getent passwd postfix &>/dev/null && userdel postfix >/dev/null
+ getent group postfix &>/dev/null && groupdel postfix >/dev/null
+ getent group postdrop &>/dev/null && groupdel postdrop >/dev/null
+}
diff --git a/testing/postfix/rc.d b/testing/postfix/rc.d
new file mode 100755
index 000000000..94ccc2af0
--- /dev/null
+++ b/testing/postfix/rc.d
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+name=postfix
+PID=$(pidof -o %PPID /usr/lib/postfix/master)
+
+case "$1" in
+start)
+ stat_busy "Starting $name daemon"
+ [[ -z "$PID" ]] && /usr/sbin/postfix start &>/dev/null \
+ && { add_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+stop)
+ stat_busy "Stopping $name daemon"
+ [[ -n "$PID" ]] && /usr/sbin/postfix stop &>/dev/null \
+ && { rm_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+reload)
+ stat_busy "Reloading $name daemon"
+ [[ -n "$PID" ]] && kill -HUP $PID &>/dev/null \
+ && { stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart|reload}"
+ ;;
+esac
+exit 0