class SNail < Formula desc "Fork of Heirloom mailx" homepage "https://www.sdaoden.eu/code.html" url "https://www.sdaoden.eu/downloads/s-nail-14.9.4.tar.gz" sha256 "d5eee1875fe065739c16f9f8aab28cb08f3c349c579016a238e8a9e4f237739d" bottle do sha256 "c779ecf867fce11c87fc5bb605e78880cce60d9f846cc72fe124a02b730a95c1" => :high_sierra sha256 "fc33f1f775a4092832245c204a1477197f633b6a86db0291834eec38151593f5" => :sierra sha256 "3c66f502325d6adc6c37f00b8ec8594855da952351189650e90f402f6899e115" => :el_capitan end depends_on "libidn" depends_on "openssl" def install system "make", "OPT_AUTOCC=no", "CC=#{ENV.cc}", "cc_maxtopt=1", "OPT_NOMEMBDBG=1", "C_INCLUDE_PATH=#{Formula["openssl"].opt_include}", "LDFLAGS=-L#{Formula["openssl"].opt_lib}", "VAL_PREFIX=#{prefix}", "OPT_DOTLOCK=no", "config" system "make", "build" system "make", "install" end test do ENV["SOURCE_DATE_EPOCH"] = "844221007" date1 = Utils.popen_read("date", "-r", "844221007", "+%a %b %e %T %Y") date2 = Utils.popen_read("date", "-r", "844221007", "+%a, %d %b %Y %T %z") expected = <<-EOS.undent From reproducible_build #{date1.chomp} Date: #{date2.chomp} To: User-Agent: s-nail reproducible_build Hello oh you Hammer2! EOS input = "Hello oh you Hammer2!\n" output = pipe_output("#{bin}/s-nail -#:/ -Sexpandaddr -", input, 0) assert_equal expected, output.chomp end end