Ticket #10332: Portfile

File Portfile, 5.1 KB (added by opendarwin@…, 18 years ago)

Update Portfile

Line 
1# $Id: Portfile,v 1.23 2005/10/30 12:10:02 yeled Exp $
2
3PortSystem      1.0
4name                    postfix
5version                 2.2.5
6revision                1
7
8categories              mail
9maintainers             yeled@opendarwin.org
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
18checksums               md5 9c13d58494c64012bfd8ab0d6967305c
19master_sites    ftp://ftp.tau.ac.il/pub/unix/mail/postfix/official/ \
20        http://postfix.problemlos.ch/release/official/ \
21        ftp://ftp.matrix.com.br/pub/postfix/official/ \
22        ftp://ftp.its.cz/MIRRORS/ftp.porcupine.org/mirrors/postfix-release/official/\
23        ftp://ftp.club-internet.fr/pub/mirrors/ftp.porcupine.org/postfix-release/official/\
24        ftp://ftp.doc.cs.univ-paris8.fr/mirrors/ftp.porcupine.org/postfix-release/official/
25
26patchfiles              patch-access.5 patch-flush.8 patch-master.8 \
27                patch-regexp_table.5 patch-sys_defs.h patch-canonical.5 \
28                patch-mail_params.h patch-pcre_table.5 patch-postdrop.1 \
29                patch-postqueue.1 patch-relocated.5 patch-transport.5 \
30                patch-cleanup.8 patch-main.cf patch-postfix-install \
31                patch-proxymap.8 patch-sendmail.1 \
32                patch-virtual.5
33#patch-sample-misc.cf
34
35set CCARGS      -DNO_PCRE
36set AUXLIBS     -L${prefix}/lib
37
38configure {
39        cd ${worksrcpath}
40        system "make makefiles CCARGS=\"${CCARGS}\" AUXLIBS=\"${AUXLIBS}\""
41        reinplace "s|__PREFIX|${prefix}|g" src/util/sys_defs.h
42        reinplace "s|__PREFIX|${prefix}|g" conf/main.cf
43        reinplace "s|__PREFIX|${prefix}|g" src/global/mail_params.h
44        reinplace "s|__PREFIX|${prefix}|g" man/man1/postdrop.1
45#       reinplace "s|__PREFIX|${prefix}|g" conf/sample-misc.cf
46        reinplace "s|__PREFIX|${prefix}|g" man/man1/postqueue.1
47        reinplace "s|__PREFIX|${prefix}|g" man/man1/sendmail.1
48        reinplace "s|__PREFIX|${prefix}|g" man/man5/access.5
49        reinplace "s|__PREFIX|${prefix}|g" man/man5/canonical.5
50        reinplace "s|__PREFIX|${prefix}|g" man/man5/pcre_table.5
51        reinplace "s|__PREFIX|${prefix}|g" man/man5/regexp_table.5
52        reinplace "s|__PREFIX|${prefix}|g" man/man5/relocated.5
53        reinplace "s|__PREFIX|${prefix}|g" man/man5/transport.5
54        reinplace "s|__PREFIX|${prefix}|g" man/man5/virtual.5
55        reinplace "s|__PREFIX|${prefix}|g" man/man8/cleanup.8
56        reinplace "s|__PREFIX|${prefix}|g" man/man8/flush.8
57        reinplace "s|__PREFIX|${prefix}|g" man/man8/master.8
58        reinplace "s|__PREFIX|${prefix}|g" man/man8/proxymap.8
59}
60
61build.target
62
63startupitem.create      yes
64startupitem.start       "${prefix}/sbin/${name} start"
65startupitem.stop        "${prefix}/sbin/${name} stop"
66
67destroot {
68        adduser postfix realname=Postfix\ Server
69        addgroup postdrop
70        cd ${worksrcpath}
71        file mkdir ${destroot}${prefix}/etc/postfix
72        file mkdir ${destroot}${prefix}/etc/rc.d
73        file mkdir ${destroot}${prefix}/share/postfix
74        xinstall -d -m 755 ${destroot}${prefix}/etc/rc.d
75        xinstall -d -o postfix -g postdrop -m \
76                710 ${destroot}${prefix}/var/spool/postfix/public
77        xinstall -d -o postfix -g postdrop -m 730 \
78                ${destroot}${prefix}/var/spool/postfix/maildrop
79        destroot.keepdirs ${destroot}${prefix}/var/spool/postfix/public \
80                ${destroot}${prefix}/var/spool/postfix/maildrop
81        system "/bin/sh postfix-install -non-interactive \
82                install_root=${destroot} \
83                config_directory=${prefix}/etc/postfix \
84                daemon_directory=${prefix}/libexec/postfix \
85                command_directory=${prefix}/sbin \
86                manpage_directory=${prefix}/share/man \
87                queue_directory=${prefix}/var/spool/postfix \
88                sendmail_path=${prefix}/sbin/sendmail \
89                newaliases_path=${prefix}/bin/newaliases \
90                mailq_path=${prefix}/bin/mailq \
91                sample_directory=${prefix}/share/postfix/sample \
92                readme_directory=${prefix}/share/postfix/readme"
93        xinstall -m 755 -c ${portpath}/files/postfix.sh ${destroot}${prefix}/etc/rc.d
94        reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/postfix.sh
95}
96# This makes sure we don't overwrite user /etc files. This now breaks postfix
97# "just working" on fresh installs.
98# YOU MUST MOVE THE SAMPLE FILES TO THE CORRECT NAMESPACE.
99# XXX unsure if this stilll an issue 07/07/05 yeled@
100post-destroot {
101        file rename ${destroot}${prefix}/etc/postfix/main.cf \
102                ${destroot}${prefix}/etc/postfix/main.cf.sample
103        file rename ${destroot}${prefix}/etc/postfix/master.cf \
104                ${destroot}${prefix}/etc/postfix/master.cf.sample
105        file rename ${destroot}${prefix}/etc/postfix/aliases \
106                ${destroot}${prefix}/etc/postfix/aliases.sample
107}
108
109post-install {
110        # Tell the user about the renaming of the configuration files.
111        ui_msg "To get postfix working, you need to copy sample configuration "
112        ui_msg "files and to edit them (${prefix}/etc/postfix/*.sample)."
113        ui_msg "You may also want to turn your system's MTA off."
114}
115
116variant pcre {
117        depends_lib-append      lib:libpcre:pcre
118        set CCARGS              [ldelete ${CCARGS} -DNO_PCRE]
119}
120
121variant tls {
122        set CCARGS              [concat ${CCARGS} -DUSE_TLS]
123        set AUXLIBS             [concat ${AUXLIBS} -lssl -lcrypto]
124}
125
126variant sasl {
127        set CCARGS              [concat ${CCARGS} -DUSE_SASL_AUTH -I/opt/local/include/sasl]
128        set AUXLIBS             [concat ${AUXLIBS} -lsasl2]
129}
130
131variant ldap {
132        set CCARGS              [concat ${CCARGS} -DHAS_LDAP]
133        set AUXLIBS             [concat ${AUXLIBS} -lldap -llber]
134}