Ticket #3796: Portfile.3

File Portfile.3, 4.7 KB (added by jbc@…, 19 years ago)

exim-4.52 portfile (fewer variants)

Line 
1# $Id: Portfile,v 1.27 2005/05/09 18:40:10 jmpp Exp $
2
3PortSystem 1.0
4name            exim
5version         4.52
6revision        1
7categories      mail
8description     complete replacement for sendmail
9long_description        Exim is a mail transfer agent (MTA) developed \
10                        at the University of Cambridge for use on Unix \
11                        systems connected to the Internet. It is freely \
12                        available under the terms of the GNU General \
13                        Public Licence. In overall style it is similar \
14                        to Smail 3, but its facilities are more extensive.
15homepage        http://www.exim.org/
16platforms       darwin
17maintainers     cms@opendarwin.org
18master_sites    ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/ \
19                ftp://ftp.exim.org/pub/exim/exim4/
20checksums       md5 299a40aaa75ee9de9f6048239cbfc38c
21depends_build   bin:perl:perl5.8
22depends_lib             lib:libdb-4:db4
23depends_run     path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
24
25set exim_user   exim
26patch.pre_args  -p1
27
28configure   {   cd ${worksrcpath}
29                system "cp src/EDITME Local/Makefile"
30                reinplace "s|/usr/exim/bin|${prefix}/sbin|g" Local/Makefile
31                reinplace "s|/usr/exim/configure|${prefix}/etc/exim/exim.conf|g" Local/Makefile
32                reinplace "s|EXIM_USER=|EXIM_USER=${exim_user}|g" Local/Makefile
33                reinplace "s|/var/spool/exim|${prefix}/var/spool/exim|g" Local/Makefile
34                reinplace "s|EXIM_MONITOR=eximon.bin|#EXIM_MONITOR=eximon.bin|g" Local/Makefile
35                                reinplace "s|# WITH_CONTENT_SCAN=yes|WITH_CONTENT_SCAN=yes|g" Local/Makefile       
36                                reinplace "s|# LOOKUP_PASSWD=yes|LOOKUP_PASSWD=yes|g" Local/Makefile
37                                reinplace "s|# LOOKUP_CDB=yes|LOOKUP_CDB=yes|g" Local/Makefile
38                                reinplace "s|# LOOKUP_DSEARCH=yes|LOOKUP_DSEARCH=yes|g" Local/Makefile
39                                reinplace "s|# SUPPORT_MAILDIR=yes|SUPPORT_MAILDIR=yes|g" Local/Makefile       
40                                reinplace "s|# Exim: OS-specific make file for Darwin (Mac OS X).|INCLUDE=-I${prefix}/include/db4|g" OS/Makefile-Darwin               
41                                reinplace "s|DBMLIB =|DBMLIB=${prefix}/lib/libdb-4.dylib|g" OS/Makefile-Darwin               
42                                reinplace "s|/etc/aliases|${destroot}${prefix}/etc/aliases|g" scripts/exim_install
43                                adduser ${exim_user} gid=[existsgroup mail] }
44
45destroot.destdir        ROOT=${destroot}
46
47post-destroot { system "mv ${destroot}${prefix}/etc/exim/exim.conf ${destroot}${prefix}/etc/exim/exim.conf.sample"
48                xinstall -o root -m 755 -d ${destroot}${prefix}/share/exim
49                cd ${worksrcpath}
50                system "cp -R doc/ ${destroot}${prefix}/share/exim"
51                xinstall -o ${exim_user} -g mail -m 750 -d ${destroot}${prefix}/var/spool/exim
52                xinstall -o root -m 755 -d ${destroot}${prefix}/etc/rc.d
53                xinstall -o root -m 755 -c \
54                     ${portpath}/files/exim.sh ${destroot}${prefix}/etc/rc.d
55                destroot.keepdirs ${destroot}${prefix}/var/spool/exim
56                reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/exim.sh }
57
58
59platform darwin 6 {
60
61        if {[variant_isset mysql] || [variant_isset mysql4]} {
62                patchfiles-append patch-EDITME
63                reinplace "s|LOOKUP_LIBS=-lresolv|LOOKUP_LIBS=-L${prefix}/lib/mysql -L${prefix}/lib -L/usr/lib -lmysqlclient|g" ${filespath}/patch-EDITME
64        }
65}
66
67platform darwin 7 {     
68        patchfiles-append       patch-EDITME
69                                               
70        if {[variant_isset mysql] || [variant_isset mysql4]} {
71                reinplace "s|LOOKUP_LIBS=-lresolv|LOOKUP_LIBS=-L${prefix}/lib/mysql -L${prefix}/lib -L/usr/lib -lresolv -lmysqlclient|g" ${filespath}/patch-EDITME
72        }
73       
74}
75
76variant smtp-auth { }
77variant tls { }
78
79variant mysql { depends_lib-append      lib:libmysqlclient:mysql }
80
81variant mysql4 { depends_lib-append      lib:libmysqlclient:mysql4 }
82
83variant ldap { }
84
85post-configure {
86        if {[variant_isset mysql] || [variant_isset mysql4]} {
87                reinplace "s|# LOOKUP_MYSQL=yes|LOOKUP_MYSQL=yes|g" Local/Makefile
88                reinplace "s|# LOOKUP_INCLUDE=.*|LOOKUP_INCLUDE=-I ${prefix}/include/mysql -I ${prefix}/include -I /usr/include|g" Local/Makefile
89        }
90
91        if {[variant_isset smtp-auth ]} {
92                reinplace "s|# AUTH_CRAM_MD5=yes|AUTH_CRAM_MD5=yes|g" Local/Makefile
93                reinplace "s|# AUTH_PLAINTEXT=yes|AUTH_PLAINTEXT=yes|g" Local/Makefile
94                reinplace "s|# AUTH_SPA=yes|AUTH_SPA=yes|g" Local/Makefile     
95        }
96        if {[variant_isset tls ]} {
97                reinplace "s|# SUPPORT_TLS=yes|SUPPORT_TLS=yes|g" Local/Makefile
98                reinplace "s|# TLS_LIBS=-lssl -lcrypto|TLS_LIBS=-lssl -lcrypto|g" Local/Makefile
99        }
100        if {[variant_isset ldap]} {
101                reinplace "s|# LDAP_LIB_TYPE=OPENLDAP2|LDAP_LIB_TYPE=OPENLDAP2|g" Local/Makefile
102                reinplace "s|# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber -lmysqlclient -lpq -lgds|LOOKUP_LIBS=-lldap|g" Local/Makefile
103        }
104}
105