a project to simplify installation of open source software
on Mac OS X and Darwin
# $Id: Portfile 23026 2007-03-22 14:05:21Z yeled@macports.org $
PortSystem 1.0
name postfix
version 2.3.8
categories mail
maintainers yeled@macports.org
description Fast and robust mail transfer agent
long_description Postfix attempts to be fast, easy to administer, and \
secure, while at the same time being \
sendmail-compatible enough to not upset existing \
users. It also offers QMQP and VERP support to let \
Postfix act as delivery daemon for ezmlm-idx.
homepage http://www.postfix.org/
platforms darwin
checksums sha1 c40ebae5cdcd53e13ae8ba5cac1a70167576859b
master_sites http://postfix.problemlos.ch/release/official/ \
http://www.swissrave.ch/mirror/postfix-source/official/ \
ftp://ftp.matrix.com.br/pub/postfix/official/ \
ftp://ftp.its.cz/MIRRORS/ftp.porcupine.org/mirrors/postfix-release/official/\
ftp://ftp.club-internet.fr/pub/mirrors/ftp.porcupine.org/postfix-release/official/\
ftp://ftp.doc.cs.univ-paris8.fr/mirrors/ftp.porcupine.org/postfix-release/official/
patchfiles patch-access.5 patch-flush.8 patch-master.8 \
patch-regexp_table.5 patch-sys_defs.h patch-canonical.5 \
patch-mail_params.h patch-pcre_table.5 patch-postdrop.1 \
patch-postqueue.1 patch-relocated.5 patch-transport.5 \
patch-cleanup.8 patch-main.cf patch-postfix-install \
patch-proxymap.8 patch-sendmail.1 \
patch-virtual.5
#patch-sample-misc.cf
set CCARGS -DNO_PCRE
set AUXLIBS -L${prefix}/lib
configure {
cd ${worksrcpath}
system "make makefiles CCARGS=\"${CCARGS}\" AUXLIBS=\"${AUXLIBS}\""
reinplace "s|__PREFIX|${prefix}|g" src/util/sys_defs.h
reinplace "s|__PREFIX|${prefix}|g" conf/main.cf
reinplace "s|__PREFIX|${prefix}|g" src/global/mail_params.h
reinplace "s|__PREFIX|${prefix}|g" man/man1/postdrop.1
# reinplace "s|__PREFIX|${prefix}|g" conf/sample-misc.cf
reinplace "s|__PREFIX|${prefix}|g" man/man1/postqueue.1
reinplace "s|__PREFIX|${prefix}|g" man/man1/sendmail.1
reinplace "s|__PREFIX|${prefix}|g" man/man5/access.5
reinplace "s|__PREFIX|${prefix}|g" man/man5/canonical.5
reinplace "s|__PREFIX|${prefix}|g" man/man5/pcre_table.5
reinplace "s|__PREFIX|${prefix}|g" man/man5/regexp_table.5
reinplace "s|__PREFIX|${prefix}|g" man/man5/relocated.5
reinplace "s|__PREFIX|${prefix}|g" man/man5/transport.5
reinplace "s|__PREFIX|${prefix}|g" man/man5/virtual.5
reinplace "s|__PREFIX|${prefix}|g" man/man8/cleanup.8
reinplace "s|__PREFIX|${prefix}|g" man/man8/flush.8
reinplace "s|__PREFIX|${prefix}|g" man/man8/master.8
reinplace "s|__PREFIX|${prefix}|g" man/man8/proxymap.8
}
build.target
startupitem.create yes
startupitem.start "${prefix}/sbin/${name} start"
startupitem.stop "${prefix}/sbin/${name} stop"
destroot {
adduser postfix realname=Postfix\ Server
addgroup postdrop
cd ${worksrcpath}
file mkdir ${destroot}${prefix}/etc/postfix
file mkdir ${destroot}${prefix}/etc/rc.d
file mkdir ${destroot}${prefix}/share/postfix
xinstall -d -m 755 ${destroot}${prefix}/etc/rc.d
xinstall -d -o postfix -g postdrop -m \
710 ${destroot}${prefix}/var/spool/postfix/public
xinstall -d -o postfix -g postdrop -m 730 \
${destroot}${prefix}/var/spool/postfix/maildrop
destroot.keepdirs ${destroot}${prefix}/var/spool/postfix/public \
${destroot}${prefix}/var/spool/postfix/maildrop
system "/bin/sh postfix-install -non-interactive \
install_root=${destroot} \
config_directory=${prefix}/etc/postfix \
daemon_directory=${prefix}/libexec/postfix \
command_directory=${prefix}/sbin \
manpage_directory=${prefix}/share/man \
queue_directory=${prefix}/var/spool/postfix \
sendmail_path=${prefix}/sbin/sendmail \
newaliases_path=${prefix}/bin/newaliases \
mailq_path=${prefix}/bin/mailq \
sample_directory=${prefix}/share/postfix/sample \
readme_directory=${prefix}/share/postfix/readme"
xinstall -m 755 -c ${portpath}/files/postfix.sh ${destroot}${prefix}/etc/rc.d
reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/postfix.sh
}
# This makes sure we don't overwrite user /etc files. This now breaks postfix
# "just working" on fresh installs.
# YOU MUST MOVE THE SAMPLE FILES TO THE CORRECT NAMESPACE.
# XXX unsure if this stilll an issue 07/07/05 yeled@
post-destroot {
file rename ${destroot}${prefix}/etc/postfix/main.cf \
${destroot}${prefix}/etc/postfix/main.cf.sample
file rename ${destroot}${prefix}/etc/postfix/master.cf \
${destroot}${prefix}/etc/postfix/master.cf.sample
file rename ${destroot}${prefix}/etc/postfix/aliases \
${destroot}${prefix}/etc/postfix/aliases.sample
}
post-install {
# Tell the user about renaming the sample configuration files.
ui_msg "\n
To get postfix working, you need to copy the sample configuration
files and edit them (${prefix}/etc/postfix/*.sample). You may also
want to turn off Apple's built-in MTA. For example, on 10.4:
-Delete or rename /System/Library/LaunchDaemons/org.postfix.master.plist
-Replace the built-in sendmail file with a symlink to MacPorts' own:
sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.org
ln -s ${prefix}/sbin/sendmail /usr/sbin/sendmail
NOTE: Apple OS updates could upgrade the built-in Postfix and overwrite the
symlink, so the symlink mught have to be recreated.
\n"
}
variant pcre {
set CCARGS [ldelete ${CCARGS} -DNO_PCRE]
set CCARGS [concat ${CCARGS} -DHAS_PCRE -I${prefix}/include]
set AUXLIBS [concat ${AUXLIBS} -L${prefix}/lib -lpcre]
depends_lib-append port:pcre
}
variant tls {
depends_lib-append port:openssl
set CCARGS [concat ${CCARGS} -DUSE_TLS -DHAS_SSL -I${prefix}/include/openssl]
set AUXLIBS [concat ${AUXLIBS} -lssl -lcrypto]
}
variant sasl {
depends_lib-append port:cyrus-sasl2
set CCARGS [concat ${CCARGS} -DUSE_CYRUS_SASL -DUSE_SASL_AUTH -I${prefix}/include/sasl]
set AUXLIBS [concat ${AUXLIBS} -lsasl2]
}
variant ldap {
depends_lib-append port:openldap
set CCARGS [concat ${CCARGS} -DHAS_LDAP]
set AUXLIBS [concat ${AUXLIBS} -lldap -llber]
}