class Nmh < Formula desc "The new version of the MH mail handler" homepage "https://www.nongnu.org/nmh/" url "https://download.savannah.gnu.org/releases/nmh/nmh-1.7.1.tar.gz" sha256 "f1fb94bbf7d95fcd43277c7cfda55633a047187f57afc6c1bb9321852bd07c11" bottle do sha256 "b0d273ecd1a67ddf6504e5aac8771bbc1b60bdea653c0635067e059eb4881507" => :mojave sha256 "4d2e05b5a522f7c394b0bcb064f48ce28b55b0a73ffe1c2ff33cc3f568167e25" => :high_sierra sha256 "de7b1a7e8ab420a918dfce7dd64eeb23fd3a1fcc158bf7525ebc1bee97fad759" => :sierra end head do url "https://git.savannah.nongnu.org/git/nmh.git" depends_on "autoconf" => :build depends_on "automake" => :build end depends_on "openssl" depends_on "w3m" def install system "./autogen.sh" if build.head? system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}", "--libdir=#{libexec}", "--with-cyrus-sasl", "--with-tls" system "make", "install" end test do (testpath/".mh_profile").write "Path: Mail" (testpath/"Mail/inbox/1").write <<~EOS From: Mister Test To: Mister Nobody Date: Tue, 5 May 2015 12:00:00 -0000 Subject: Hello! How are you? EOS ENV["TZ"] = "GMT" output = shell_output("#{bin}/scan -width 80") assert_equal(" 1 05/05 Mister Test Hello!<>\n", output) end end