Ticket #512: Portfile

File Portfile, 3.1 KB (added by bchesneau@…, 22 years ago)

Portfile

Line 
1PortSystem 1.0
2name            courier-imap
3version         1.7.1
4revision        1
5categories      mail
6maintainers     bchesneau@mac.com
7description     IMAP server
8long_description        This package contains the standalone Courier IMAP server, which is used to provide IMAP access to local mailboxes. Courier-IMAP is provided here as a separate package that can be used with other mail servers as well.
9
10homepage        http://prdownloads.sourceforge.net/courier/
11platforms       darwin
12master_sites    http://heanet.dl.sourceforge.net/sourceforge/courier/ \
13                http://unc.dl.sourceforge.net/sourceforge/courier/ \
14                http://easynews.dl.sourceforge.net/sourceforge/courier/
15use_bzip2       yes
16checksums       courier-imap-1.7.1.tar.bz2 md5 ce3a78cabd3d69e4982907de69ecac96
17
18depends_lib    lib:libssl.0.9:openssl
19depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
20
21set authdaemondir ${prefix}/var/run/authdaemon.courier-imap
22
23configure.env   CFLAGS=-no-cpp-precomp \
24                LANG=C
25 
26configure.args  --bindir=${prefix}/bin --mandir=${prefix}/share/man --sysconfdir=${prefix}/etc/courier --localstatedir=${prefix}/var/run --datadir=${prefix}/share/courier --with-piddir=${prefix}/var/run --with-authdaemonvar=${authdaemondir} --enable-workarounds-for-imap-client-bugs --enable-unicode=iso-8859-1,utf-8 --disable-root-check
27
28variant darwin {
29        depends_lib-append      lib:libdl.1:dlcompat
30        patchfiles              patch-authpam.c patch-rfc1035_res.h
31        configure.args-append   --with-waitfunc=wait3
32}
33
34variant mysql {
35        depends_lib-append      lib:libmysqlclient:mysql
36        configure.env-append    LDFLAGS=-L${prefix}/lib/mysql \
37                                CPPFLAGS=-I${prefix}/include/mysql
38       
39}
40
41variant pam { }
42
43variant ldap { }
44
45variant postgres {
46        configure.env-append    LDFLAGS=-L${prefix}/lib -L${prefix}/pgsql/lib \
47                                CPPFLAGS=-I${prefix}/include/ -I${prefix}/pgsql/include
48        depends_lib-append      lib:plpgsql:postgresql
49}
50
51variant berkdb { }
52
53variant ipv6 { }
54
55pre-configure {
56        if { ![variant_isset mysql]} {
57                configure.args-append --without-authmysql
58        }
59        if { ![variant_isset ldap]} {
60                configure.args-append --without-authldap
61        }
62        if { ![variant_isset pam]} {
63                configure.args-append --without-authpam
64        }
65        if { ![variant_isset postgres]} {
66                configure.args-append --without-authpostgresql
67        }
68        if { [variant_isset berkdb]} {
69                configure.args-append --with-db=db
70        }
71        if { ![variant_isset ipv6]} {
72                configure.args-append --without-ipv6
73        }
74}
75
76
77install {
78        system "cd ${workpath}/${worksrcdir}"
79        system "make install DESTDIR=${destroot}"
80        system "make install-configure DESTDIR=${destroot}"
81}
82
83post-install {
84        file mkdir ${destroot}${prefix}/var/run
85        file mkdir ${destroot}${prefix}/etc/rc.d
86        file mkdir ${destroot}${authdaemondir}
87        system "install -o root -m 755 -c \
88                      ${portpath}/files/*.sh ${destroot}${prefix}/etc/rc.d"
89        system "install -o root -m 755 -c \
90                      ${portpath}/files/authdaemond.conf ${destroot}${prefix}/etc/courier"
91        reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/imapd.sh
92        reinplace "s|ulimit|#ulimit|g" ${destroot}${prefix}/libexex/imapd.rc
93        reinplace "s|ulimit|#ulimit|g" ${destroot}${prefix}/libexex/imapd-ssl.rc
94
95}