1 | # $Id: Portfile 35604 2008-03-30 23:25:26Z wsiegrist@apple.com $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name postfix |
---|
6 | version 2.5.2 |
---|
7 | categories mail |
---|
8 | maintainers wms |
---|
9 | description Fast and robust mail transfer agent |
---|
10 | long_description Postfix attempts to be fast, easy to administer, and \ |
---|
11 | secure, while at the same time being \ |
---|
12 | sendmail-compatible enough to not upset existing \ |
---|
13 | users. It also offers QMQP and VERP support to let \ |
---|
14 | Postfix act as delivery daemon for ezmlm-idx. |
---|
15 | homepage http://www.postfix.org/ |
---|
16 | platforms darwin |
---|
17 | checksums md5 b0965aea4d548d9bd231af7143aa6942 \ |
---|
18 | sha1 6589c590b2e2a955bce5615bde1a86c37c572ce0 |
---|
19 | master_sites http://www.swissrave.ch/mirror/postfix-source/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 | |
---|
23 | patchfiles patch-sys_defs.h patch-mail_params.h patch-postfix-install |
---|
24 | |
---|
25 | post-patch { |
---|
26 | eval reinplace "s|/etc/|${prefix}/etc/|g" \ |
---|
27 | [glob ${worksrcpath}/man/man1/*] \ |
---|
28 | [glob ${worksrcpath}/man/man5/*] \ |
---|
29 | [glob ${worksrcpath}/man/man8/*] |
---|
30 | |
---|
31 | reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/src/util/sys_defs.h |
---|
32 | reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/src/global/mail_params.h |
---|
33 | |
---|
34 | reinplace "s|#default_privs|default_privs|g" \ |
---|
35 | ${worksrcpath}/conf/main.cf |
---|
36 | reinplace "s|/etc/postfix/network_table|${prefix}/etc/postfix/network_table|g" \ |
---|
37 | ${worksrcpath}/conf/main.cf |
---|
38 | reinplace "s|/etc/postfix/relay_recipients|${prefix}/etc/postfix_relay_recipients|g" \ |
---|
39 | ${worksrcpath}/conf/main.cf |
---|
40 | reinplace "s|/etc/postfix/header_checks|${prefix}/etc/postfix/header_checks|g" \ |
---|
41 | ${worksrcpath}/conf/main.cf |
---|
42 | reinplace "s|/bin:/usr/bin|${prefix}/bin:/bin:/usr/bin|g" \ |
---|
43 | ${worksrcpath}/conf/main.cf |
---|
44 | } |
---|
45 | |
---|
46 | set CCARGS -DNO_PCRE |
---|
47 | set AUXLIBS "-L${prefix}/lib -R${prefix}/lib -L${prefix}/lib" |
---|
48 | set pf_mail_owner "postfix" |
---|
49 | set pf_setgid_group "postdrop" |
---|
50 | |
---|
51 | # Beginning with Mac OS X 10.5, the user 'postfix' changed to '_postfix' |
---|
52 | platform darwin 9 { |
---|
53 | global pf_mail_owner |
---|
54 | global pf_setgid_group |
---|
55 | set pf_mail_owner "_postfix" |
---|
56 | set pf_setgid_group "_postdrop" |
---|
57 | } |
---|
58 | |
---|
59 | configure { |
---|
60 | system "make makefiles CCARGS=\"${CCARGS}\" AUXLIBS=\"${AUXLIBS}\"" |
---|
61 | } |
---|
62 | |
---|
63 | build.target |
---|
64 | |
---|
65 | startupitem.create yes |
---|
66 | startupitem.start "${prefix}/sbin/${name} start" |
---|
67 | startupitem.stop "${prefix}/sbin/${name} stop" |
---|
68 | |
---|
69 | destroot { |
---|
70 | # adduser postfix realname=Postfix\ Server |
---|
71 | # addgroup postdrop |
---|
72 | # file mkdir ${destroot}${prefix}/etc/postfix |
---|
73 | # file mkdir ${destroot}${prefix}/share/postfix |
---|
74 | # xinstall -d -o postfix -g postdrop -m \ |
---|
75 | # 710 ${destroot}${prefix}/var/spool/postfix/public |
---|
76 | # xinstall -d -o postfix -g postdrop -m 730 \ |
---|
77 | # ${destroot}${prefix}/var/spool/postfix/maildrop |
---|
78 | destroot.keepdirs ${destroot}${prefix}/var/spool/postfix/public \ |
---|
79 | ${destroot}${prefix}/var/spool/postfix/maildrop \ |
---|
80 | ${destroot}${prefix}/var/lib/postfix |
---|
81 | system "cd ${worksrcpath} && /bin/sh postfix-install -non-interactive \ |
---|
82 | install_root=${destroot} \ |
---|
83 | config_directory=${prefix}/etc/postfix \ |
---|
84 | queue_directory=${prefix}/var/spool/postfix \ |
---|
85 | command_directory=${prefix}/sbin \ |
---|
86 | daemon_directory=${prefix}/libexec/postfix \ |
---|
87 | data_directory=${prefix}/var/lib/postfix \ |
---|
88 | sendmail_path=${prefix}/sbin/sendmail \ |
---|
89 | newaliases_path=${prefix}/bin/newaliases \ |
---|
90 | mailq_path=${prefix}/bin/mailq \ |
---|
91 | etc_directory=${prefix}/etc/postfix \ |
---|
92 | share_directory=${prefix}/share/postfix \ |
---|
93 | manpage_directory=${prefix}/share/man \ |
---|
94 | sample_directory=${prefix}/share/postfix/sample \ |
---|
95 | readme_directory=${prefix}/share/postfix/readme \ |
---|
96 | mail_owner=${pf_mail_owner} \ |
---|
97 | setgid_group=${pf_setgid_group}" |
---|
98 | |
---|
99 | # This makes sure we don't overwrite user /etc files. This now breaks postfix |
---|
100 | # "just working" on fresh installs. |
---|
101 | # YOU MUST MOVE THE SAMPLE FILES TO THE CORRECT NAMESPACE. |
---|
102 | # XXX unsure if this still an issue 07/07/05 yeled@ |
---|
103 | |
---|
104 | file rename ${destroot}${prefix}/etc/postfix/main.cf \ |
---|
105 | ${destroot}${prefix}/etc/postfix/main.cf.sample |
---|
106 | file rename ${destroot}${prefix}/etc/postfix/master.cf \ |
---|
107 | ${destroot}${prefix}/etc/postfix/master.cf.sample |
---|
108 | file rename ${destroot}${prefix}/etc/postfix/aliases \ |
---|
109 | ${destroot}${prefix}/etc/postfix/aliases.sample |
---|
110 | } |
---|
111 | |
---|
112 | post-install { |
---|
113 | # Tell the user about renaming the sample configuration files. |
---|
114 | ui_msg "\n |
---|
115 | To get postfix working, you need to copy the sample configuration |
---|
116 | files and edit them (${prefix}/etc/postfix/*.sample). You may also |
---|
117 | want to turn off Apple's built-in MTA. For example, on 10.4: |
---|
118 | |
---|
119 | -Delete or rename /System/Library/LaunchDaemons/org.postfix.master.plist |
---|
120 | -Replace the built-in sendmail file with a symlink to MacPorts' own: |
---|
121 | sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.org |
---|
122 | ln -s ${prefix}/sbin/sendmail /usr/sbin/sendmail |
---|
123 | |
---|
124 | NOTE: Apple OS updates could upgrade the built-in Postfix and overwrite the |
---|
125 | symlink, so the symlink mught have to be recreated. |
---|
126 | \n" |
---|
127 | } |
---|
128 | |
---|
129 | variant pcre description "add pcre support" { |
---|
130 | set CCARGS [ldelete ${CCARGS} -DNO_PCRE] |
---|
131 | set CCARGS [concat ${CCARGS} -DHAS_PCRE -I${prefix}/include] |
---|
132 | set AUXLIBS [concat ${AUXLIBS} -L${prefix}/lib -lpcre] |
---|
133 | depends_lib-append port:pcre |
---|
134 | } |
---|
135 | |
---|
136 | variant tls description "add tls supporti via openssl" { |
---|
137 | depends_lib-append port:openssl |
---|
138 | set CCARGS [concat ${CCARGS} -DUSE_TLS -DHAS_SSL -I${prefix}/include] |
---|
139 | set AUXLIBS [concat ${AUXLIBS} -lssl -lcrypto] |
---|
140 | } |
---|
141 | |
---|
142 | variant sasl description "add sasl support via cyrus-sasl2" { |
---|
143 | depends_lib-append port:cyrus-sasl2 |
---|
144 | set CCARGS [concat ${CCARGS} -DUSE_CYRUS_SASL -DUSE_SASL_AUTH -I${prefix}/include/sasl] |
---|
145 | set AUXLIBS [concat ${AUXLIBS} -lsasl2] |
---|
146 | } |
---|
147 | |
---|
148 | variant ldap description "add ldap support via openldap" { |
---|
149 | depends_lib-append port:openldap |
---|
150 | set CCARGS [concat ${CCARGS} -DHAS_LDAP] |
---|
151 | set AUXLIBS [concat ${AUXLIBS} -lldap -llber] |
---|
152 | } |
---|
153 | |
---|
154 | variant mysql5 description "add mysql support via mysql5" { |
---|
155 | depends_lib-append port:mysql5 |
---|
156 | set CCARGS [concat ${CCARGS} -DHAS_MYSQL -I${prefix}/include/mysql5/mysql] |
---|
157 | set AUXLIBS [concat ${AUXLIBS} -L${prefix}/lib/mysql5/mysql -lmysqlclient -lz -lm] |
---|
158 | } |
---|