# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
description The Cyrus IMAP Server
long_description Popular, scalable, open standars based IMAP & POP3 mail server \
developed by The Carnegie Mellon University.
homepage http://cyrusimap.org/
master_sites ftp://ftp.cyrusimap.org/cyrus-imapd/ \
https://www.cyrusimap.org/releases/old
distname cyrus-imapd-${version}
checksums rmd160 8263f17933e40959c34e51ea8ece3e1020519f0e \
sha256 98839d2865c0ff5c5dc0f59aba54ad111135697c3383919e037651d90f00aaaa
depends_build port:makedepend
path:lib/libssl.dylib:openssl
patchfiles patch-util_h.diff \
# Check for any db* installation
if {[glob -nocomplain ${prefix}/include/db*] != ""} {
set db_list [lsort [glob ${prefix}/include/db\[0-9\]*]]
set current_db [lindex ${db_list} end]
set db_ver [string range [lindex [split ${current_db} "/"] end] end-1 end]
depends_lib-append port:db60
ui_msg "Selected db${db_ver}"
foreach dir {contrib contrib/cyrus-graphtools.1.0/cgi-bin contrib/cyrus-graphtools.1.0/script perl/imap/examples perl/sieve/scripts tools} {
reinplace "s|^#!.*perl|#!${prefix}/bin/perl|" {*}[glob -d ${worksrcpath}/${dir} *.pl]
# wrong number of arguments at (eval 1) line 41, <DATA> line 256.
configure.perl ${prefix}/bin/perl5
configure.args --mandir=${prefix}/share/man \
--sysconfdir=${prefix}/etc/cyrus \
--with-cyrus-prefix=${prefix} \
--with-pidfile=${prefix}/var/run/cyrus-master.pid \
--with-bdb-incdir=${prefix}/include/db${db_ver} \