2015-02-27 13:01:22 +00:00
|
|
|
class Sha2 < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Implementation of SHA-256, SHA-384, and SHA-512 hash algorithms"
|
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
|
2015-05-06 05:21:51 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "e087ba4357e2ed9d75bd2d25253c0982ac742db854d1c7c6792671d58e05bdc8" => :yosemite
|
|
|
|
sha256 "7bb393c6de372210c1343a76094063a344f59f7bfeed67210abc749e9dfb93aa" => :mavericks
|
|
|
|
sha256 "dc28fabf8cd4680b5ff534de7ef19ad95c4b839f6b891f80292e6ac9bd0952ad" => :mountain_lion
|
2015-02-27 22:45:44 +00:00
|
|
|
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
|