Ticket #3796: Portfile.2

File Portfile.2, 4.9 KB (added by jbc@…, 19 years ago)

exim-4.52 portfile (corrected)

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|# Exim: OS-specific make file for Darwin (Mac OS X).|INCLUDE=-I${prefix}/include/db4|g" OS/Makefile-Darwin               
36                                reinplace "s|DBMLIB =|DBMLIB=${prefix}/lib/libdb-4.dylib|g" OS/Makefile-Darwin               
37                                reinplace "s|/etc/aliases|${destroot}${prefix}/etc/aliases|g" scripts/exim_install
38                                adduser ${exim_user} gid=[existsgroup mail] }
39
40destroot.destdir        ROOT=${destroot}
41
42post-destroot { system "mv ${destroot}${prefix}/etc/exim/exim.conf ${destroot}${prefix}/etc/exim/exim.conf.sample"
43                xinstall -o root -m 755 -d ${destroot}${prefix}/share/exim
44                cd ${worksrcpath}
45                system "cp -R doc/ ${destroot}${prefix}/share/exim"
46                xinstall -o ${exim_user} -g mail -m 750 -d ${destroot}${prefix}/var/spool/exim
47                xinstall -o root -m 755 -d ${destroot}${prefix}/etc/rc.d
48                xinstall -o root -m 755 -c \
49                     ${portpath}/files/exim.sh ${destroot}${prefix}/etc/rc.d
50                destroot.keepdirs ${destroot}${prefix}/var/spool/exim
51                reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/exim.sh }
52
53
54platform darwin 6 {
55
56        if {[variant_isset mysql] || [variant_isset mysql4]} {
57                patchfiles-append patch-EDITME
58                reinplace "s|LOOKUP_LIBS=-lresolv|LOOKUP_LIBS=-L${prefix}/lib/mysql -L${prefix}/lib -L/usr/lib -lmysqlclient|g" ${filespath}/patch-EDITME
59        }
60}
61
62platform darwin 7 {     
63        patchfiles-append       patch-EDITME
64                                               
65        if {[variant_isset mysql] || [variant_isset mysql4]} {
66                reinplace "s|LOOKUP_LIBS=-lresolv|LOOKUP_LIBS=-L${prefix}/lib/mysql -L${prefix}/lib -L/usr/lib -lresolv -lmysqlclient|g" ${filespath}/patch-EDITME
67        }
68       
69}
70
71variant smtp-auth { }
72variant tls { }
73
74variant exiscan { }
75
76variant passwd { }
77
78variant cdb { }
79
80variant dsearch { }
81
82variant mysql { depends_lib-append      lib:libmysqlclient:mysql }
83
84variant mysql4 { depends_lib-append      lib:libmysqlclient:mysql4 }
85
86variant maildir { }
87
88variant ldap { }
89
90post-configure {
91        if {[variant_isset exiscan ]} {
92                reinplace "s|# WITH_CONTENT_SCAN=yes|WITH_CONTENT_SCAN=yes|g" Local/Makefile       
93        }
94
95        if {[variant_isset passwd]} {
96                reinplace "s|# LOOKUP_PASSWD=yes|LOOKUP_PASSWD=yes|g" Local/Makefile
97        }
98
99        if {[variant_isset cdb]} {
100                reinplace "s|# LOOKUP_CDB=yes|LOOKUP_CDB=yes|g" Local/Makefile
101        }
102
103        if {[variant_isset dsearch]} {
104                reinplace "s|# LOOKUP_DSEARCH=yes|LOOKUP_DSEARCH=yes|g" Local/Makefile
105        }
106
107        if {[variant_isset mysql] || [variant_isset mysql4]} {
108                reinplace "s|# LOOKUP_MYSQL=yes|LOOKUP_MYSQL=yes|g" Local/Makefile
109                reinplace "s|# LOOKUP_INCLUDE=.*|LOOKUP_INCLUDE=-I ${prefix}/include/mysql -I ${prefix}/include -I /usr/include|g" Local/Makefile
110        }
111
112        if {[variant_isset maildir ]} {
113                reinplace "s|# SUPPORT_MAILDIR=yes|SUPPORT_MAILDIR=yes|g" Local/Makefile       
114        }
115
116        if {[variant_isset smtp-auth ]} {
117                reinplace "s|# AUTH_CRAM_MD5=yes|AUTH_CRAM_MD5=yes|g" Local/Makefile
118                reinplace "s|# AUTH_PLAINTEXT=yes|AUTH_PLAINTEXT=yes|g" Local/Makefile
119                reinplace "s|# AUTH_SPA=yes|AUTH_SPA=yes|g" Local/Makefile     
120        }
121        if {[variant_isset tls ]} {
122                reinplace "s|# SUPPORT_TLS=yes|SUPPORT_TLS=yes|g" Local/Makefile
123                reinplace "s|# TLS_LIBS=-lssl -lcrypto|TLS_LIBS=-lssl -lcrypto|g" Local/Makefile
124        }
125        if {[variant_isset ldap]} {
126                reinplace "s|# LDAP_LIB_TYPE=OPENLDAP2|LDAP_LIB_TYPE=OPENLDAP2|g" Local/Makefile
127                reinplace "s|# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber -lmysqlclient -lpq -lgds|LOOKUP_LIBS=-lldap|g" Local/Makefile
128        }
129}
130