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

Last change on this file since 153481 was 153481, checked in by jmr@…, 3 years ago

postfix: update to 3.1.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.2 KB
RevLine 
[20332]1# $Id: Portfile 153481 2016-10-02 06:15:52Z jmr@macports.org $
[2125]2
[19050]3PortSystem  1.0
[30008]4
[19050]5name            postfix
[153481]6version         3.1.3
[19050]7categories      mail
[95899]8license         IBMPL-1
[68844]9maintainers     jmr openmaintainer
[19050]10description     Fast and robust mail transfer agent
11long_description    Postfix attempts to be fast, easy to administer, and \
12            secure, while at the same time being \
13            sendmail-compatible enough to not upset existing \
14            users. It also offers QMQP and VERP support to let \
15            Postfix act as delivery daemon for ezmlm-idx.
16homepage        http://www.postfix.org/
17platforms       darwin
[153481]18checksums       rmd160 d974c821d39ff273bafeba06e69aca57cb56d374 \
19                sha256 52f8127e6797e2617a36d0afb9473c55e95c3a777b6280df3f106168fd814979
[56521]20
[148891]21master_sites    https://archive.mgm51.com/mirrors/postfix-source/official/ \
[68844]22                http://de.postfix.org/ftpmirror/official/ \
23                ftp://ftp.its.cz/MIRRORS/ftp.porcupine.org/mirrors/postfix-release/official/ \
24                ftp://ftp.cuhk.edu.hk/pub/packages/mail-server/postfix/official/ \
25                http://mirror.postfix.jp/postfix-release/official/ \
[127126]26                http://postfix.bbnx.net/source/official/ \
27                http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/
[14885]28
[75551]29patchfiles      patch-sys_defs.h patch-mail_params.h patch-postfix-install \
[132889]30                patch-makedefs patch-postfix-script
[1090]31
[30008]32post-patch {
[132889]33     reinplace "s|/etc/|${prefix}/etc/|g" \
34          {*}[glob ${worksrcpath}/man/man1/*] \
35          {*}[glob ${worksrcpath}/man/man5/*] \
36          {*}[glob ${worksrcpath}/man/man8/*]
[30024]37
[68844]38     reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/src/util/sys_defs.h \
[132889]39                                        ${worksrcpath}/src/global/mail_params.h \
40                                        ${worksrcpath}/makedefs
[37338]41
42# Set main.cf default values
43     reinplace "s|#default_privs|default_privs|g" \
44          ${worksrcpath}/conf/main.cf
45     reinplace "s|/etc/postfix/network_table|${prefix}/etc/postfix/network_table|g" \
46          ${worksrcpath}/conf/main.cf
47     reinplace "s|/etc/postfix/relay_recipients|${prefix}/etc/postfix_relay_recipients|g" \
48          ${worksrcpath}/conf/main.cf
49     reinplace "s|/etc/postfix/header_checks|${prefix}/etc/postfix/header_checks|g" \
50          ${worksrcpath}/conf/main.cf
51     reinplace "s|PATH=/bin:/usr/bin|PATH=${prefix}/bin:/bin:/usr/bin|g" \
52          ${worksrcpath}/conf/main.cf
[30008]53}
54
[132889]55set CCARGS  [list -DNO_EAI -DNO_PCRE]
56set AUXLIBS [list -L${prefix}/lib]
[68844]57if {[variant_isset universal]} {
58    set CCARGS [concat ${CCARGS} ${configure.universal_cflags}]
59    set AUXLIBS [concat ${AUXLIBS} ${configure.universal_ldflags}]
60} else {
61    set CCARGS [concat ${CCARGS} ${configure.cc_archflags}]
62    set AUXLIBS [concat ${AUXLIBS} ${configure.ld_archflags}]
63}
[132889]64set pf_mail_owner _postfix
65set pf_setgid_group _postdrop
[68844]66set config_files [list main.cf master.cf access aliases canonical generic \
67                  header_checks relocated transport virtual]
[3477]68
[37338]69# Beginning with Mac OS X 10.5, the user 'postfix' changed to '_postfix'
[56520]70platform darwin 8 {
[132889]71    set pf_mail_owner postfix
72    set pf_setgid_group postdrop
[37338]73}
74
[2948]75configure {
[132889]76    system -W ${worksrcpath} "${build.cmd} makefiles CC='${configure.cc}' \
[68844]77        OPT='${configure.optflags}' CCARGS='${CCARGS}' AUXLIBS='${AUXLIBS}'"
[2948]78}
[1090]79
[1683]80build.target
[1090]81
[14885]82startupitem.create      yes
[19080]83startupitem.start       "${prefix}/sbin/${name} start"
84startupitem.stop        "${prefix}/sbin/${name} stop"
[1152]85
[3173]86destroot {
[19050]87    destroot.keepdirs ${destroot}${prefix}/var/spool/postfix/public \
[37338]88        ${destroot}${prefix}/var/spool/postfix/maildrop \
89        ${destroot}${prefix}/var/lib/postfix
[132889]90    system -W ${worksrcpath} "/bin/sh postfix-install -non-interactive \
[19050]91        install_root=${destroot} \
92        config_directory=${prefix}/etc/postfix \
[37338]93        queue_directory=${prefix}/var/spool/postfix \
94        command_directory=${prefix}/sbin \
[19080]95        daemon_directory=${prefix}/libexec/postfix \
[37338]96        data_directory=${prefix}/var/lib/postfix \
[19050]97        sendmail_path=${prefix}/sbin/sendmail \
98        newaliases_path=${prefix}/bin/newaliases \
99        mailq_path=${prefix}/bin/mailq \
[37338]100        etc_directory=${prefix}/etc/postfix \
101        share_directory=${prefix}/share/postfix \
102        manpage_directory=${prefix}/share/man \
[19050]103        sample_directory=${prefix}/share/postfix/sample \
[37338]104        readme_directory=${prefix}/share/postfix/readme \
105        mail_owner=${pf_mail_owner} \
106        setgid_group=${pf_setgid_group}"
107
[138397]108# add in future when shared libraries are enabled
109#shlib_directory=${prefix}/lib/postfix
110
[68844]111        # This makes sure we don't overwrite user cf files.
112        foreach f $config_files {
113            move ${destroot}${prefix}/etc/postfix/${f} \
114                 ${destroot}${prefix}/etc/postfix/${f}.sample
115        }
[5169]116
[71982]117        if {[geteuid] == 0} {
118            system "chown -R ${pf_mail_owner} \
119                '${destroot}${prefix}/var/spool/postfix/public' \
120                '${destroot}${prefix}/var/lib/postfix'"
[86380]121        }
122}
123
124pre-install {
125        if {[geteuid] != 0} {
[71982]126            ui_msg "Insufficient privileges to chown files; you'll need to do this manually:"
127            ui_msg "sudo chown -R ${pf_mail_owner} ${prefix}/var/spool/postfix/public ${prefix}/var/lib/postfix"
128        }
[41192]129}
130
[68844]131post-activate {
132    foreach f $config_files {
133        if {![file exists ${prefix}/etc/postfix/${f}]} {
134            copy ${prefix}/etc/postfix/${f}.sample \
135                 ${prefix}/etc/postfix/${f}
136        }
137    }
[5169]138}
[12979]139
[68844]140# Tell the user about renaming the sample configuration files.
[91636]141notes "
142To get postfix working, you need to edit the configuration files\
143(${prefix}/etc/postfix/*). You may also want to turn off Apple's built-in MTA.\
144For example:
[68844]145
[91636]146sudo launchctl unload -w /System/Library/LaunchDaemons/org.postfix.master.plist
147"
[68844]148
[132889]149variant dovecot_sasl description "add Dovecot SASL support" {
150    lappend CCARGS  -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE="dovecot"
151}
152
153variant ldap description "add ldap support via openldap" {
154    depends_lib-append  port:openldap
155    lappend CCARGS  -DHAS_LDAP
156    lappend AUXLIBS -lldap -llber
157}
158
[35604]159variant pcre description "add pcre support" {
[19080]160    set CCARGS      [ldelete ${CCARGS} -DNO_PCRE]
[132889]161    lappend CCARGS  -DHAS_PCRE -I${prefix}/include
162    lappend AUXLIBS -lpcre
[19080]163    depends_lib-append  port:pcre
[12979]164}
165
[35604]166variant sasl description "add sasl support via cyrus-sasl2" {
[19080]167    depends_lib-append  port:cyrus-sasl2
[132889]168    lappend CCARGS  -DUSE_CYRUS_SASL -DUSE_SASL_AUTH -I${prefix}/include/sasl
[68844]169    lappend AUXLIBS -lsasl2
[19080]170}
171
[132889]172variant smtputf8 description "add support for UTF-8 email addresses and headers (EAI) via icu" {
173    depends_lib-append port:icu
174    set CCARGS      [ldelete ${CCARGS} -DNO_EAI]
175    lappend CCARGS  -I${prefix}/include
[19080]176}
[25371]177
[132889]178variant tls description "add tls support via openssl" {
[139229]179    depends_lib-append  path:lib/libssl.dylib:openssl
[132889]180    lappend CCARGS  -DUSE_TLS -DHAS_SSL -I${prefix}/include
181    lappend AUXLIBS -lssl -lcrypto
182}
183
[92728]184# Keep the mysql5 variant until the mysql5 port is replaced_by mysql51 port.
[119211]185variant mysql5  conflicts mysql51 mysql55 mysql56 mariadb percona description "add MySQL support via mysql5" {
[92728]186    depends_lib-append path:bin/mysql_config5:mysql5
[132889]187    lappend CCARGS  -DHAS_MYSQL -I${prefix}/include/mysql5/mysql
188    lappend AUXLIBS -L${prefix}/lib/mysql5/mysql -lmysqlclient -lz -lm
[92729]189}
[92728]190
[119211]191variant mysql51 conflicts mysql5 mysql55 mysql56 mariadb percona description "add MySQL support via mysql51" {
[92485]192    depends_lib-append port:mysql51
[132889]193    lappend CCARGS  -DHAS_MYSQL -I${prefix}/include/mysql51/mysql
194    lappend AUXLIBS -L${prefix}/lib/mysql51/mysql -lmysqlclient -lz -lm
[25371]195}
[49627]196
[119211]197variant mysql55 conflicts mysql5 mysql51 mysql56 mariadb percona description "add MySQL support via mysql55" {
[92485]198    depends_lib-append port:mysql55
[132889]199    lappend CCARGS  -DHAS_MYSQL -I${prefix}/include/mysql55/mysql
200    lappend AUXLIBS -L${prefix}/lib/mysql55/mysql -lmysqlclient -lz -lm
[92485]201}
202
[119211]203variant mysql56 conflicts mysql5 mysql51 mysql55 mariadb percona description "add MySQL support via mysql56" {
204    depends_lib-append port:mysql56
[132889]205    lappend CCARGS  -DHAS_MYSQL -I${prefix}/include/mysql56/mysql
206    lappend AUXLIBS -L${prefix}/lib/mysql56/mysql -lmysqlclient -lz -lm
[119211]207}
208
209variant mariadb conflicts mysql5 mysql51 mysql55 mysql56 percona description "add MySQL support via mariadb" {
[110778]210    depends_lib-append port:mariadb
[132889]211    lappend CCARGS  -DHAS_MYSQL -I${prefix}/include/mariadb/mysql
212    lappend AUXLIBS -L${prefix}/lib/mariadb/mysql -lmysqlclient -lz -lm
[92485]213}
214
[119211]215variant percona conflicts mysql5 mysql51 mysql55 mysql56 mariadb description "add MySQL support via percona" {
[110778]216    depends_lib-append port:percona
[132889]217    lappend CCARGS  -DHAS_MYSQL -I${prefix}/include/percona/mysql
218    lappend AUXLIBS -L${prefix}/lib/percona/mysql -lmysqlclient -lz -lm
[92485]219}
220
[97972]221variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 postgresql92 description "add postgresql support via postgresql83" {
[49627]222    depends_lib-append port:postgresql83
[132889]223    lappend CCARGS  -DHAS_PGSQL -I${prefix}/include/postgresql83
224    lappend AUXLIBS -L${prefix}/lib/postgresql83 -lpq
[49627]225}
[51390]226
[97972]227variant postgresql84 conflicts postgresql83 postgresql90 postgresql91 postgresql92 description "add postgresql support via postgresql84" {
[68844]228    depends_lib-append port:postgresql84
[132889]229    lappend CCARGS  -DHAS_PGSQL -I${prefix}/include/postgresql84
230    lappend AUXLIBS -L${prefix}/lib/postgresql84 -lpq
[68844]231}
232
[97972]233variant postgresql90 conflicts postgresql83 postgresql84 postgresql91 postgresql92 description "add postgresql support via postgresql90" {
[71981]234    depends_lib-append port:postgresql90
[132889]235    lappend CCARGS  -DHAS_PGSQL -I${prefix}/include/postgresql90
236    lappend AUXLIBS -L${prefix}/lib/postgresql90 -lpq
[71981]237}
238
[97972]239variant postgresql91 conflicts postgresql83 postgresql84 postgresql90 postgresql92 description "add postgresql support via postgresql91" {
[88864]240    depends_lib-append port:postgresql91
[132889]241    lappend CCARGS  -DHAS_PGSQL -I${prefix}/include/postgresql91
242    lappend AUXLIBS -L${prefix}/lib/postgresql91 -lpq
[88864]243}
244
[97972]245variant postgresql92 conflicts postgresql83 postgresql84 postgresql90 postgresql91 description "add postgresql support via postgresql92" {
246    depends_lib-append port:postgresql92
[132889]247    lappend CCARGS  -DHAS_PGSQL -I${prefix}/include/postgresql92
248    lappend AUXLIBS -L${prefix}/lib/postgresql92 -lpq
[97972]249}
250
[80813]251livecheck.type  regex
252livecheck.url   ftp://ftp.porcupine.org/mirrors/postfix-release/official/
253livecheck.regex ${name}-(\[0-9.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.