2015-08-18 03:18:32 +00:00
|
|
|
require "formula"
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Exim < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Complete replacement for sendmail"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "http://exim.org"
|
2015-08-18 03:18:32 +00:00
|
|
|
url "http://ftp.exim.org/pub/exim/exim4/old/exim-4.85.tar.bz2"
|
|
|
|
mirror "https://www.mirrorservice.org/sites/ftp.exim.org/pub/exim/exim4/old/exim-4.85.tar.bz2"
|
|
|
|
sha256 "13211f2bbc5400d095a9b4be075eb1347e0d98676fdfe4be8a3b4d56281daaa4"
|
2010-02-23 21:23:43 +00:00
|
|
|
|
2015-02-15 20:10:37 +00:00
|
|
|
bottle do
|
2015-05-07 22:54:53 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "78e5eb89f3b324114f453d64f9a6955f60abe8fcde2e0c32acc19649e1cdbacb" => :yosemite
|
|
|
|
sha256 "beae28cb7ca235377eeb0bc04218154a2a0c29ec2942fbae52ac67f321e99b41" => :mavericks
|
|
|
|
sha256 "28f88bffa0447b615552d5a80c31ff8a762afd801a803429cf015af00aafae8b" => :mountain_lion
|
2015-02-15 20:10:37 +00:00
|
|
|
end
|
|
|
|
|
2015-08-18 03:18:32 +00:00
|
|
|
option "support-maildir", "Support delivery in Maildir format"
|
2012-08-26 06:29:12 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
depends_on "pcre"
|
2015-08-18 03:18:32 +00:00
|
|
|
depends_on "berkeley-db4"
|
2015-08-03 12:55:31 +00:00
|
|
|
depends_on "openssl"
|
2012-03-18 18:27:32 +00:00
|
|
|
|
2010-02-23 21:23:43 +00:00
|
|
|
def install
|
2015-08-03 12:55:31 +00:00
|
|
|
cp "src/EDITME", "Local/Makefile"
|
|
|
|
inreplace "Local/Makefile" do |s|
|
2010-02-23 21:23:43 +00:00
|
|
|
s.remove_make_var! "EXIM_MONITOR"
|
2015-08-03 12:55:31 +00:00
|
|
|
s.change_make_var! "EXIM_USER", ENV["USER"]
|
|
|
|
s.change_make_var! "SYSTEM_ALIASES_FILE", etc/"aliases"
|
|
|
|
s.gsub! "/usr/exim/configure", etc/"exim.conf"
|
|
|
|
s.gsub! "/usr/exim", prefix
|
|
|
|
s.gsub! "/var/spool/exim", var/"spool/exim"
|
2013-09-25 13:16:46 +00:00
|
|
|
# http://trac.macports.org/ticket/38654
|
2015-08-03 12:55:31 +00:00
|
|
|
s.gsub! 'TMPDIR="/tmp"', "TMPDIR=/tmp"
|
2015-08-18 03:18:32 +00:00
|
|
|
s << "SUPPORT_MAILDIR=yes\n" if build.include? "support-maildir"
|
2012-10-27 16:37:07 +00:00
|
|
|
s << "AUTH_PLAINTEXT=yes\n"
|
|
|
|
s << "SUPPORT_TLS=yes\n"
|
|
|
|
s << "TLS_LIBS=-lssl -lcrypto\n"
|
2015-05-07 22:04:31 +00:00
|
|
|
s << "TRANSPORT_LMTP=yes\n"
|
2010-02-23 21:23:43 +00:00
|
|
|
|
|
|
|
# For non-/usr/local HOMEBREW_PREFIX
|
|
|
|
s << "LOOKUP_INCLUDE=-I#{HOMEBREW_PREFIX}/include\n"
|
|
|
|
s << "LOOKUP_LIBS=-L#{HOMEBREW_PREFIX}/lib\n"
|
2012-05-15 22:13:49 +00:00
|
|
|
end
|
2010-07-29 19:12:51 +00:00
|
|
|
|
2015-08-18 03:18:32 +00:00
|
|
|
bdb4 = Formula["berkeley-db4"]
|
2012-10-28 21:42:31 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
inreplace "OS/Makefile-Darwin" do |s|
|
|
|
|
s.remove_make_var! %w[CC CFLAGS]
|
2012-10-28 21:42:31 +00:00
|
|
|
# Add include and lib paths for BDB 4
|
2015-08-18 03:18:32 +00:00
|
|
|
s.gsub! "# Exim: OS-specific make file for Darwin (Mac OS X).", "INCLUDE=-I#{bdb4.include}"
|
|
|
|
s.gsub! "DBMLIB =", "DBMLIB=#{bdb4.lib}/libdb-4.dylib"
|
2010-02-23 21:23:43 +00:00
|
|
|
end
|
2010-07-29 19:12:51 +00:00
|
|
|
|
|
|
|
# The compile script ignores CPPFLAGS
|
2015-08-03 12:55:31 +00:00
|
|
|
ENV.append "CFLAGS", ENV.cppflags
|
2010-07-29 19:12:51 +00:00
|
|
|
|
2012-03-18 18:27:32 +00:00
|
|
|
ENV.j1 # See: https://lists.exim.org/lurker/thread/20111109.083524.87c96d9b.en.html
|
2010-02-23 21:23:43 +00:00
|
|
|
system "make"
|
2015-08-18 03:18:32 +00:00
|
|
|
system "make INSTALL_ARG=-no_chown install"
|
2015-08-03 12:55:31 +00:00
|
|
|
man8.install "doc/exim.8"
|
|
|
|
(bin+"exim_ctl").write startup_script
|
2010-02-23 21:23:43 +00:00
|
|
|
end
|
2010-07-29 19:12:51 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
# Inspired by MacPorts startup script. Fixes restart issue due to missing setuid.
|
2012-03-18 18:27:32 +00:00
|
|
|
def startup_script; <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
PID=#{var}/spool/exim/exim-daemon.pid
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo "starting exim mail transfer agent"
|
|
|
|
#{bin}/exim -bd -q30m
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
echo "restarting exim mail transfer agent"
|
|
|
|
/bin/kill -15 `/bin/cat $PID` && sleep 1 && #{bin}/exim -bd -q30m
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
echo "stopping exim mail transfer agent"
|
|
|
|
/bin/kill -15 `/bin/cat $PID`
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: #{bin}/exim_ctl {start|stop|restart}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
EOS
|
2010-02-23 21:23:43 +00:00
|
|
|
end
|
2010-07-29 19:12:51 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Start with:
|
|
|
|
exim_ctl start
|
|
|
|
Don't forget to run it as root to be able to bind port 25.
|
2010-02-23 21:23:43 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|