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"
|
2016-01-28 13:21:13 +00:00
|
|
|
homepage "http://aarongifford.com/computers/sha.html"
|
2016-02-28 01:47:05 +00:00
|
|
|
url "https://aarongifford.com/computers/sha2-1.0.1.tgz"
|
2015-05-05 22:23:07 +00:00
|
|
|
sha256 "67bc662955c6ca2fa6a0ce372c4794ec3d0cd2c1e50b124e7a75af7e23dd1d0c"
|
2015-02-27 13:01:22 +00:00
|
|
|
|
2015-02-27 22:45:44 +00:00
|
|
|
bottle do
|
2016-01-28 15:21:32 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-02-28 19:03:18 +00:00
|
|
|
revision 3
|
|
|
|
sha256 "84ce281185ba415257d8507e9b16ba8dc3189ec8b8414d21a6421d5979a025d2" => :el_capitan
|
|
|
|
sha256 "da63b7e9be95c91bcdc3290e3c6caee12016c5d59960144ea26f8c6438dfe680" => :yosemite
|
|
|
|
sha256 "34650fbb427aa57f452acc23a338696756792907bd7e127d7b495a7fd7e4573a" => :mavericks
|
2015-02-27 22:45:44 +00:00
|
|
|
end
|
|
|
|
|
2015-12-08 12:13:38 +00:00
|
|
|
option "without-test", "Skip compile-time tests"
|
|
|
|
|
|
|
|
deprecated_option "without-check" => "without-test"
|
2015-02-27 13:01:22 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system ENV.cc, "-o", "sha2", "sha2prog.c", "sha2.c"
|
2015-12-08 12:13:38 +00:00
|
|
|
system "perl", "sha2test.pl" if build.with? "test"
|
2015-02-27 13:01:22 +00:00
|
|
|
bin.install "sha2"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-12-08 12:13:38 +00:00
|
|
|
(testpath/"checkme.txt").write "homebrew"
|
2016-01-28 13:21:13 +00:00
|
|
|
output = "12c87370d1b5472793e67682596b60efe2c6038d63d04134a1a88544509737b4"
|
|
|
|
assert_match output, pipe_output("#{bin}/sha2 -q -256 #{testpath}/checkme.txt")
|
2015-02-27 13:01:22 +00:00
|
|
|
end
|
|
|
|
end
|