2015-02-27 13:01:22 +00:00
|
|
|
class Sha2 < Formula
|
2015-05-05 22:23:07 +00:00
|
|
|
homepage "https://www.aarongifford.com/computers/sha.html"
|
|
|
|
url "https://www.aarongifford.com/computers/sha2-1.0.1.tgz"
|
|
|
|
sha256 "67bc662955c6ca2fa6a0ce372c4794ec3d0cd2c1e50b124e7a75af7e23dd1d0c"
|
2015-02-27 13:01:22 +00:00
|
|
|
|
2015-02-27 22:45:44 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 "df93015804de4b208f7eb7c3e6ea390aa4839da0" => :yosemite
|
|
|
|
sha1 "6a70d9dab98a22b03aa83b735746c356fcfd4ced" => :mavericks
|
|
|
|
sha1 "23658e75f2a245c7fbcb63d792db85a5b8c9d5c0" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2015-02-27 13:01:22 +00:00
|
|
|
option "without-check", "Skip compile-time tests"
|
|
|
|
|
|
|
|
def install
|
|
|
|
system ENV.cc, "-o", "sha2", "sha2prog.c", "sha2.c"
|
|
|
|
system "perl", "sha2test.pl" if build.with? "check"
|
|
|
|
bin.install "sha2"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"checkme.txt").write("homebrew")
|
|
|
|
output = pipe_output("#{bin}/sha2 -q -256 #{testpath}/checkme.txt")
|
|
|
|
expected = "12c87370d1b5472793e67682596b60efe2c6038d63d04134a1a88544509737b4"
|
|
|
|
assert output.include? expected
|
|
|
|
end
|
|
|
|
end
|