source: trunk/dports/mail/postfix/Portfile @ 20332

Last change on this file since 20332 was 20332, checked in by blair@…, 14 years ago

Set the svn:keywords property to 'Id' for all Portfile's. This
re-enables the Id keyword substitution that was present in the CVS
repository.

See this thread for more information:
http://lists.macosforge.org/pipermail/macports-dev/2006-October/000180.html

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.1 KB
Line 
1# $Id: Portfile 20332 2006-11-02 00:31:05Z blair@macports.org $
2
3PortSystem  1.0
4name            postfix
5version         2.3.2
6categories      mail
7maintainers     yeled@macports.org
8description     Fast and robust mail transfer agent
9long_description    Postfix attempts to be fast, easy to administer, and \
10            secure, while at the same time being \
11            sendmail-compatible enough to not upset existing \
12            users. It also offers QMQP and VERP support to let \
13            Postfix act as delivery daemon for ezmlm-idx.
14homepage        http://www.postfix.org/
15platforms       darwin
16checksums       md5 b1e482eea6a340041b8a637e62b15e3c
17master_sites    ftp://ftp.tau.ac.il/pub/unix/mail/postfix/official/ \
18    http://postfix.problemlos.ch/release/official/ \
19    ftp://ftp.matrix.com.br/pub/postfix/official/ \
20    ftp://ftp.its.cz/MIRRORS/ftp.porcupine.org/mirrors/postfix-release/official/\
21    ftp://ftp.club-internet.fr/pub/mirrors/ftp.porcupine.org/postfix-release/official/\
22    ftp://ftp.doc.cs.univ-paris8.fr/mirrors/ftp.porcupine.org/postfix-release/official/
23
24patchfiles      patch-access.5 patch-flush.8 patch-master.8 \
25        patch-regexp_table.5 patch-sys_defs.h patch-canonical.5 \
26        patch-mail_params.h patch-pcre_table.5 patch-postdrop.1 \
27        patch-postqueue.1 patch-relocated.5 patch-transport.5 \
28        patch-cleanup.8 patch-main.cf patch-postfix-install \
29        patch-proxymap.8 patch-sendmail.1 \
30        patch-virtual.5
31#patch-sample-misc.cf
32
33set CCARGS  -DNO_PCRE
34set AUXLIBS -L${prefix}/lib
35
36configure {
37    cd ${worksrcpath}
38    system "make makefiles CCARGS=\"${CCARGS}\" AUXLIBS=\"${AUXLIBS}\""
39    reinplace "s|__PREFIX|${prefix}|g" src/util/sys_defs.h
40    reinplace "s|__PREFIX|${prefix}|g" conf/main.cf
41    reinplace "s|__PREFIX|${prefix}|g" src/global/mail_params.h
42    reinplace "s|__PREFIX|${prefix}|g" man/man1/postdrop.1
43#   reinplace "s|__PREFIX|${prefix}|g" conf/sample-misc.cf
44    reinplace "s|__PREFIX|${prefix}|g" man/man1/postqueue.1
45    reinplace "s|__PREFIX|${prefix}|g" man/man1/sendmail.1
46    reinplace "s|__PREFIX|${prefix}|g" man/man5/access.5
47    reinplace "s|__PREFIX|${prefix}|g" man/man5/canonical.5
48    reinplace "s|__PREFIX|${prefix}|g" man/man5/pcre_table.5
49    reinplace "s|__PREFIX|${prefix}|g" man/man5/regexp_table.5
50    reinplace "s|__PREFIX|${prefix}|g" man/man5/relocated.5
51    reinplace "s|__PREFIX|${prefix}|g" man/man5/transport.5
52    reinplace "s|__PREFIX|${prefix}|g" man/man5/virtual.5
53    reinplace "s|__PREFIX|${prefix}|g" man/man8/cleanup.8
54    reinplace "s|__PREFIX|${prefix}|g" man/man8/flush.8
55    reinplace "s|__PREFIX|${prefix}|g" man/man8/master.8
56    reinplace "s|__PREFIX|${prefix}|g" man/man8/proxymap.8
57}
58
59build.target
60
61startupitem.create      yes
62startupitem.start       "${prefix}/sbin/${name} start"
63startupitem.stop        "${prefix}/sbin/${name} stop"
64
65destroot {
66    adduser postfix realname=Postfix\ Server
67    addgroup postdrop
68    cd ${worksrcpath}
69    file mkdir ${destroot}${prefix}/etc/postfix
70    file mkdir ${destroot}${prefix}/etc/rc.d
71    file mkdir ${destroot}${prefix}/share/postfix
72    xinstall -d -m 755 ${destroot}${prefix}/etc/rc.d
73    xinstall -d -o postfix -g postdrop -m \
74        710 ${destroot}${prefix}/var/spool/postfix/public
75    xinstall -d -o postfix -g postdrop -m 730 \
76        ${destroot}${prefix}/var/spool/postfix/maildrop
77    destroot.keepdirs ${destroot}${prefix}/var/spool/postfix/public \
78        ${destroot}${prefix}/var/spool/postfix/maildrop
79    system "/bin/sh postfix-install -non-interactive \
80        install_root=${destroot} \
81        config_directory=${prefix}/etc/postfix \
82        daemon_directory=${prefix}/libexec/postfix \
83        command_directory=${prefix}/sbin \
84        manpage_directory=${prefix}/share/man \
85        queue_directory=${prefix}/var/spool/postfix \
86        sendmail_path=${prefix}/sbin/sendmail \
87        newaliases_path=${prefix}/bin/newaliases \
88        mailq_path=${prefix}/bin/mailq \
89        sample_directory=${prefix}/share/postfix/sample \
90        readme_directory=${prefix}/share/postfix/readme"
91    xinstall -m 755 -c ${portpath}/files/postfix.sh ${destroot}${prefix}/etc/rc.d
92    reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/postfix.sh
93}
94# This makes sure we don't overwrite user /etc files. This now breaks postfix
95# "just working" on fresh installs.
96# YOU MUST MOVE THE SAMPLE FILES TO THE CORRECT NAMESPACE.
97# XXX unsure if this stilll an issue 07/07/05 yeled@
98post-destroot {
99    file rename ${destroot}${prefix}/etc/postfix/main.cf \
100        ${destroot}${prefix}/etc/postfix/main.cf.sample
101    file rename ${destroot}${prefix}/etc/postfix/master.cf \
102        ${destroot}${prefix}/etc/postfix/master.cf.sample
103    file rename ${destroot}${prefix}/etc/postfix/aliases \
104        ${destroot}${prefix}/etc/postfix/aliases.sample
105}
106
107post-install {
108    # Tell the user about renaming the sample configuration files.
109ui_msg "\n
110To get postfix working, you need to copy the sample configuration
111files and edit them (${prefix}/etc/postfix/*.sample).  You may also
112want to turn off Apple's built-in MTA.  For example, on 10.4:
113   
114-Delete or rename /System/Library/LaunchDaemons/org.postfix.master.plist
115-Replace the built-in sendmail file with a symlink to MacPorts' own:
116        sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.org
117        ln -s ${prefix}/sbin/sendmail /usr/sbin/sendmail
118       
119NOTE: Apple OS updates could upgrade the built-in Postfix and overwrite the
120      symlink, so the symlink mught have to be recreated.
121\n"
122}
123
124variant pcre {
125    set CCARGS      [ldelete ${CCARGS} -DNO_PCRE]
126    set CCARGS      [concat  ${CCARGS} -DHAS_PCRE -I${prefix}/include]
127    set AUXLIBS     [concat ${AUXLIBS} -L${prefix}/lib -lpcre]
128    depends_lib-append  port:pcre
129}
130
131variant tls {
132    depends_lib-append  port:openssl
133    set CCARGS      [concat ${CCARGS} -DUSE_TLS]
134    set AUXLIBS     [concat ${AUXLIBS} -lssl -lcrypto]
135}
136
137variant sasl {
138    depends_lib-append  port:cyrus-sasl2
139    set CCARGS      [concat ${CCARGS} -DUSE_SASL_AUTH -I${prefix}/include/sasl]
140    set AUXLIBS     [concat ${AUXLIBS} -lsasl2]
141}
142
143variant ldap {
144    depends_lib-append  port:openldap
145    set CCARGS      [concat ${CCARGS} -DHAS_LDAP]
146    set AUXLIBS     [concat ${AUXLIBS} -lldap -llber]
147}
Note: See TracBrowser for help on using the repository browser.