49 lines
1.6 KiB
Ruby
49 lines
1.6 KiB
Ruby
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.9.tar.gz"
|
|
sha256 "cdbd278b634f32df80f22d0a3fc7e59b0d5f3d41a19fef4638efcb6c2d198490"
|
|
|
|
bottle do
|
|
sha256 "619cd4365432f51fb6d7b83af256eaa120b11cb78994d6d28b63963419f408df" => :high_sierra
|
|
sha256 "207b3ab750207534d1ca4dc80a92e9db7e1ab6d96fc0d4a11877606f606abff3" => :sierra
|
|
sha256 "97fa9566dc4de2ba1b2d688a5651aebb07cd2c8a21227e68e698c370aeb052f1" => :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
|
|
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
|