Ticket #512: Portfile.4

File Portfile.4, 3.0 KB (added by bchesneau@…, 21 years ago)

Portfile

Line 
1PortSystem 1.0
2name            courier-imap
3version         2.0.0   
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-2.0.0.tar.bz2 md5 636816de2338eac4ad66d9d406020cba
17depends_lib    lib:libssl.0.9:openssl
18depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
19
20set authdaemondir ${prefix}/var/run/authdaemon.courier-imap
21
22configure.env   CFLAGS=-no-cpp-precomp \
23                LANG=C
24 
25configure.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
26
27variant darwin {
28        depends_lib-append      lib:libdl.1:dlcompat
29        patchfiles              patch-rfc1035_res.h
30        configure.args-append   --with-waitfunc=wait3
31}
32
33variant mysql {
34        depends_lib-append      lib:libmysqlclient:mysql
35        configure.env-append    LDFLAGS=-L${prefix}/lib/mysql \
36                                CPPFLAGS=-I${prefix}/include/mysql
37}
38
39variant postgres {
40        configure.env-append    LDFLAGS=-L${prefix}/lib -L${prefix}/pgsql/lib \
41                                CPPFLAGS=-I${prefix}/include/ -I${prefix}/pgsql/include
42        depends_lib-append      lib:plpgsql:postgresql
43}
44
45variant berkdb {
46        depends_lib-append      lib:libdb-4.1:db4       
47        configure.env-append    CPPFLAGS=-I${prefix}/include/db4
48}
49
50pre-configure {
51       
52        if { ![variant_isset mysql]} {
53                configure.args-append --without-authmysql
54        }
55        if { ![variant_isset ldap]} {
56                configure.args-append --without-authldap
57        }
58        if { ![variant_isset pam]} {
59                configure.args-append --without-authpam
60        }
61        if { ![variant_isset postgres]} {
62                configure.args-append --without-authpostgresql
63        }
64        if { [variant_isset berkdb]} {
65                configure.args-append --with-db=db
66        }
67}
68
69
70install {
71        system "cd ${workpath}/${worksrcdir}"
72        system "make install DESTDIR=${destroot}"
73        system "make install-configure DESTDIR=${destroot}"
74}
75
76post-install {
77        file mkdir ${destroot}${prefix}/var/run
78        file mkdir ${destroot}${prefix}/etc/rc.d
79        file mkdir ${destroot}${authdaemondir}
80        system "touch ${destroot}${authdaemondir}/.turd"
81
82        system "install -o root -m 755 -c \
83                      ${portpath}/files/*.sh ${destroot}${prefix}/etc/rc.d"
84        reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/imapd.sh
85        reinplace "s|ulimit|#ulimit|g" ${destroot}${prefix}/libexec/imapd.rc
86        reinplace "s|ulimit|#ulimit|g" ${destroot}${prefix}/libexec/imapd-ssl.rc
87
88}