47 lines
1.5 KiB
Ruby
47 lines
1.5 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.17.tar.gz"
|
|
sha256 "f94eeb64a9e9e83a36f103377a1ef315070ea6388a8aaef4a5a943fd2660df26"
|
|
|
|
bottle do
|
|
sha256 "ade61071f416cb8714d5f19e140edf9b1a690a4a5971e1b2231b84e9ae4391a4" => :catalina
|
|
sha256 "35e4528d24bb3837f54f824138385537ac58b91acc10b1e5780130cfaa6e498e" => :mojave
|
|
sha256 "0a362c6e60a40878c01e745bec5ae54d01c8e3a06066fe35af8c0104d7b875c5" => :high_sierra
|
|
end
|
|
|
|
depends_on "awk" => :build
|
|
depends_on "libidn"
|
|
depends_on "openssl@1.1"
|
|
|
|
def install
|
|
system "make", "CC=#{ENV.cc}",
|
|
"C_INCLUDE_PATH=#{Formula["openssl@1.1"].opt_include}",
|
|
"LDFLAGS=-L#{Formula["openssl@1.1"].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}
|
|
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
|