Ticket #512: Portfile.3

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

corrct berkdb variant

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
40variant postgres {
41        configure.env-append    LDFLAGS=-L${prefix}/lib -L${prefix}/pgsql/lib \
42                                CPPFLAGS=-I${prefix}/include/ -I${prefix}/pgsql/include
43        depends_lib-append      lib:plpgsql:postgresql
44}
45
46variant berkdb {
47        depends_lib-append      lib:libdb-4.1:db4       
48        configure.env-append    CPPFLAGS=-I${prefix}/include/db4
49}
50
51pre-configure {
52       
53        if { ![variant_isset mysql]} {
54                configure.args-append --without-authmysql
55        }
56        if { ![variant_isset ldap]} {
57                configure.args-append --without-authldap
58        }
59        if { ![variant_isset pam]} {
60                configure.args-append --without-authpam
61        }
62        if { ![variant_isset postgres]} {
63                configure.args-append --without-authpostgresql
64        }
65        if { [variant_isset berkdb]} {
66                configure.args-append --with-db=db
67        }
68}
69
70
71install {
72        system "cd ${workpath}/${worksrcdir}"
73        system "make install DESTDIR=${destroot}"
74        system "make install-configure DESTDIR=${destroot}"
75}
76
77post-install {
78        file mkdir ${destroot}${prefix}/var/run
79        file mkdir ${destroot}${prefix}/etc/rc.d
80        file mkdir ${destroot}${authdaemondir}
81        system "install -o root -m 755 -c \
82                      ${portpath}/files/*.sh ${destroot}${prefix}/etc/rc.d"
83        system "install -o root -m 755 -c \
84                      ${portpath}/files/authdaemond.conf ${destroot}${prefix}/etc/courier"
85        reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/imapd.sh
86        reinplace "s|ulimit|#ulimit|g" ${destroot}${prefix}/libexec/imapd.rc
87        reinplace "s|ulimit|#ulimit|g" ${destroot}${prefix}/libexec/imapd-ssl.rc
88
89}