--- Portfile.orig 2012-09-21 23:24:02.000000000 +0300 +++ Portfile 2013-01-25 08:54:13.000000000 +0200 @@ -26,6 +26,39 @@ ftp://ftp.easynet.be/exim/exim/exim4/old/ use_bzip2 yes + +patch.pre_args -p0 +patchfiles patch-src::remove_header.patch + +if {[variant_isset hide_expand_error]} then { +patchfiles-append patch-src::hide_expand_error.patch +} +if {[variant_isset lmtp_extern]} then { +patchfiles-append patch-src::lmtp-extern-4.63.patch +} +if {[variant_isset recursive_acl]} then { +patchfiles-append patch-src::recursive-acl.patch +} +if {[variant_isset rfc2047_mimelen]} then { +patchfiles-append patch-src::rfc2047-mimelen.patch +} +if {[variant_isset rfc2047_utf8_fix]} then { +patchfiles-append patch-src::rfc2047-utf8-fix.patch +} +if {[variant_isset rfc2231]} then { +patchfiles-append patch-src::rfc2231.patch +} +if {[variant_isset spamd_next_try]} then { +patchfiles-append patch-src::spamd-next-try.patch +} +if {[variant_isset spool_mbox]} then { +patchfiles-append patch-src::spool_mbox.patch +} +if {[variant_isset user_unknown_defer2fail]} then { +patchfiles-append patch-src::user-unknown-defer2fail.patch +} + + checksums md5 f9c5a2d94b5bb132d06e2fff85bef75e \ sha1 4b8f853843edcfa4f3bfbb4bef45d8dcff2fc990 \ rmd160 22e4ad1d43693d61fa1f2f2de40dda647599a087 @@ -40,6 +73,8 @@ startupitem.create yes startupitem.start "${prefix}/share/exim/exim.sh start" startupitem.stop "${prefix}/share/exim/exim.sh stop" +startupitem.restart "${prefix}/share/exim/exim.sh restart" +startupitem.pidfile auto ${prefix}/var/spool/exim/exim-daemon.pid set exim_user exim @@ -83,6 +118,9 @@ xinstall -o root -m 755 -c \ ${portpath}/files/exim.sh ${destroot}${prefix}/share/exim reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/share/exim/exim.sh + xinstall -o root -m 755 -c \ + ${portpath}/files/exim ${destroot}${prefix}/etc/rc.d/exim + reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/exim } variant mysql4 conflicts mysql5 description {build exim with support for mysql4 lookups} { @@ -101,6 +139,38 @@ depends_lib-append port:openldap } + +variant perl description {build exim with support for embedded perl} { + depends_lib-append path:bin/perl:perl5 +} +variant sqlite description {build exim with support for sqlite lookups} { + depends_lib-append port:sqlite3 +} +variant dlfunc description {build exim with support for dlfunc} { + # do nothing .. until post-configure +} +variant hide_expand_error description {patch exim to hide expand errors in smtp answers} { +} +variant lmtp_extern description {patch exim to use lmtp code externally} { +} +variant recursive_acl description {patch exim to increase recursive acl limit} { +} +variant rfc2047_mimelen description {patch exim to fix RFC2047 mimelen limit} { +} +variant rfc2047_utf8_fix description {patch exim to fix RFC2047 UTF-8 string folding} { +} +variant rfc2231 description {patch exim to implement RFC2231} { +} +variant spamd_next_try description {patch exim to make three attempts to connect to spamd} { +} +variant spool_mbox description {patch exim to save some aditional headers in spool file} { +} +variant user_unknown_defer2fail description {patch exim to escalate error level fro user unknown errors} { +} + +default_variants +sqlite +dlfunc +lmtp_extern +recursive_acl +spool_mbox + + post-configure { reinplace "s|# AUTH_CRAM_MD5=yes|AUTH_CRAM_MD5=yes|g" ${worksrcpath}/Local/Makefile reinplace "s|# AUTH_PLAINTEXT=yes|AUTH_PLAINTEXT=yes|g" ${worksrcpath}/Local/Makefile @@ -139,6 +209,55 @@ reinplace "s|^LOOKUP_INCLUDE=.*|& -I${prefix}/include |g" ${worksrcpath}/Local/Makefile } } + + + if {[variant_isset perl]} then { + reinplace "s|^# EXIM_PERL=perl.o|EXIM_PERL=perl.o|g" ${worksrcpath}/Local/Makefile + + set PERL_CCOPTS [exec /usr/bin/perl -MExtUtils::Embed -e ccopts] + regsub -all "(^|\[ \t\])-arch i386(\[ \t]|$)" $PERL_CCOPTS \\1\\2 PERL_CCOPTS + set reinplace_code "s|^# PERL_CCOPTS=|PERL_CCOPTS=" + append reinplace_code $PERL_CCOPTS + append reinplace_code "|g" + reinplace $reinplace_code ${worksrcpath}/Local/Makefile + + set PERL_LIBS [exec /usr/bin/perl -MExtUtils::Embed -e ldopts] + regsub -all "(^|\[ \t\])-arch i386(\[ \t]|$)" $PERL_LIBS \\1\\2 PERL_LIBS + set reinplace_code "s|^# PERL_LIBS=|PERL_LIBS=" + append reinplace_code $PERL_LIBS + append reinplace_code "|g" + reinplace $reinplace_code ${worksrcpath}/Local/Makefile + } + if {[variant_isset dlfunc]} then { + reinplace "s|^# EXPAND_DLFUNC=yes|EXPAND_DLFUNC=yes|g" ${worksrcpath}/Local/Makefile + system "/bin/echo '# EXTRALIBS+=-rdynamic' >>${worksrcpath}/Local/Makefile" + system "/bin/echo 'EXTRALIBS+=-ldl' >>${worksrcpath}/Local/Makefile" + } + if {[variant_isset sqlite]} then { + reinplace "s|^# LOOKUP_INCLUDE=.*|LOOKUP_INCLUDE=|g" ${worksrcpath}/Local/Makefile + reinplace "s|^# LOOKUP_LIBS=.*|LOOKUP_LIBS=-L${prefix}/lib|g" ${worksrcpath}/Local/Makefile + reinplace "s|^# LOOKUP_SQLITE=yes|LOOKUP_SQLITE=yes|g" ${worksrcpath}/Local/Makefile + reinplace "s|^LOOKUP_LIBS=.*|& -L${prefix}/lib -lsqlite3 |g" ${worksrcpath}/Local/Makefile + reinplace "s|^LOOKUP_INCLUDE=.*|& -I${prefix}/include |g" ${worksrcpath}/Local/Makefile + } + + +} + +post-install { + ui_msg "****************************************************************" + ui_msg "* *" + ui_msg "* Back-up /usr/sbin/sendmail and make /usr/sbin/sendmail as *" + ui_msg "* symlink to /opt/local/sbin/exim *" + ui_msg "* *" + ui_msg "* If sendmail (or postfix) is running, stop the daemons. *" + ui_msg "* *" + ui_msg "* Run '/opt/local/etc/rc.d/exim start' to start the daemon. *" + ui_msg "* *" + ui_msg "* Configuring log rotation is dependent on personal taste and *" + ui_msg "* the version of OS in use. *" + ui_msg "* *" + ui_msg "****************************************************************" } livecheck.type regex