homebrew-core/Formula/mutt.rb
2019-03-13 10:01:37 +01:00

92 lines
2.7 KiB
Ruby

# Note: Mutt has a large number of non-upstream patches available for
# it, some of which conflict with each other. These patches are also
# not kept up-to-date when new versions of mutt (occasionally) come
# out.
#
# To reduce Homebrew's maintenance burden, patches are not accepted
# for this formula. The NeoMutt project has a Homebrew tap for their
# patched version of Mutt: https://github.com/neomutt/homebrew-neomutt
class Mutt < Formula
desc "Mongrel of mail user agents (part elm, pine, mush, mh, etc.)"
homepage "http://www.mutt.org/"
url "https://bitbucket.org/mutt/mutt/downloads/mutt-1.11.4.tar.gz"
sha256 "b651357ea6c8762178080493991c77ecb111d916d171d422500257ab48be2801"
bottle do
sha256 "97670ca1fcd312b643feab03a2c5394d31a5e64ad2c87ccbb1f0aaf7d2b0e043" => :mojave
sha256 "3930e0247de8fdf7b4c4c0cc246b5c501f255bed8050f82d85262ef0aa6f4f11" => :high_sierra
sha256 "a48c9125b61c717c557cc0e1520cb367d39362382ff99787ccd6d3670ef40ceb" => :sierra
end
head do
url "https://gitlab.com/muttmua/mutt.git"
resource "html" do
url "https://muttmua.gitlab.io/mutt/manual-dev.html"
end
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gpgme"
depends_on "openssl"
depends_on "tokyo-cabinet"
conflicts_with "tin",
:because => "both install mmdf.5 and mbox.5 man pages"
def install
user_in_mail_group = Etc.getgrnam("mail").mem.include?(ENV["USER"])
effective_group = Etc.getgrgid(Process.egid).name
args = %W[
--disable-dependency-tracking
--disable-warnings
--prefix=#{prefix}
--enable-debug
--enable-hcache
--enable-imap
--enable-pop
--enable-sidebar
--enable-smtp
--with-gss
--with-sasl
--with-ssl=#{Formula["openssl"].opt_prefix}
--with-tokyocabinet
--enable-gpgme
]
system "./prepare", *args
system "make"
# This permits the `mutt_dotlock` file to be installed under a group
# that isn't `mail`.
# https://github.com/Homebrew/homebrew/issues/45400
unless user_in_mail_group
inreplace "Makefile", /^DOTLOCK_GROUP =.*$/, "DOTLOCK_GROUP = #{effective_group}"
end
system "make", "install"
doc.install resource("html") if build.head?
end
def caveats; <<~EOS
mutt_dotlock(1) has been installed, but does not have the permissions lock
spool files in /var/mail. To grant the necessary permissions, run
sudo chgrp mail #{bin}/mutt_dotlock
sudo chmod g+s #{bin}/mutt_dotlock
Alternatively, you may configure `spoolfile` in your .muttrc to a file inside
your home directory.
EOS
end
test do
system bin/"mutt", "-D"
touch "foo"
system bin/"mutt_dotlock", "foo"
system bin/"mutt_dotlock", "-u", "foo"
end
end