2015-07-14 01:01:33 +00:00
|
|
|
class Minisign < Formula
|
2015-07-14 01:48:06 +00:00
|
|
|
desc "Sign files & verify signatures. Works with signify in OpenBSD."
|
2015-07-14 01:01:33 +00:00
|
|
|
homepage "https://jedisct1.github.io/minisign/"
|
2015-11-11 02:17:18 +00:00
|
|
|
url "https://github.com/jedisct1/minisign/archive/0.5.tar.gz"
|
|
|
|
sha256 "31162b0634367d9130a44a60bdaedac1f7abf466563aa4d7dcb9260fb73f07cc"
|
2015-07-14 01:01:33 +00:00
|
|
|
|
2015-07-14 01:58:50 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-11-12 00:37:46 +00:00
|
|
|
sha256 "65b7a36e3090ccc3bf36cf6e9db6d0f4bafddc02367a9708f8d8dd7ec3dca785" => :el_capitan
|
|
|
|
sha256 "71e0499e55343f41e3a7761fb90085b8b7c72fcf3928c0685a3c7d69f7faa0d0" => :yosemite
|
|
|
|
sha256 "ce86a3055695f8b760440702c240edd5166539caf99ebc8cf6b8d3f5ea17d487" => :mavericks
|
2015-07-14 01:58:50 +00:00
|
|
|
end
|
|
|
|
|
2015-07-14 01:01:33 +00:00
|
|
|
depends_on "libsodium"
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "cmake", ".", *std_cmake_args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-11-01 23:48:49 +00:00
|
|
|
(testpath/"homebrew.txt").write "Hello World!"
|
|
|
|
(testpath/"keygen.sh").write <<-EOS.undent
|
|
|
|
#!/usr/bin/expect -f
|
|
|
|
set timeout -1
|
|
|
|
spawn #{bin}/minisign -G
|
|
|
|
expect -exact "Please enter a password to protect the secret key."
|
|
|
|
expect -exact "\n"
|
|
|
|
expect -exact "Password: "
|
|
|
|
send -- "Homebrew\n"
|
|
|
|
expect -exact "\r
|
|
|
|
Password (one more time): "
|
|
|
|
send -- "Homebrew\n"
|
|
|
|
expect eof
|
|
|
|
EOS
|
|
|
|
chmod 0755, testpath/"keygen.sh"
|
|
|
|
|
|
|
|
system "./keygen.sh"
|
|
|
|
assert File.exist?("minisign.pub")
|
|
|
|
assert File.exist?("minisign.key")
|
|
|
|
|
|
|
|
(testpath/"signing.sh").write <<-EOS.undent
|
|
|
|
#!/usr/bin/expect -f
|
|
|
|
set timeout -1
|
|
|
|
spawn #{bin}/minisign -Sm homebrew.txt
|
|
|
|
expect -exact "Password: "
|
|
|
|
send -- "Homebrew\n"
|
|
|
|
expect eof
|
|
|
|
EOS
|
|
|
|
chmod 0755, testpath/"signing.sh"
|
|
|
|
|
|
|
|
system "./signing.sh"
|
|
|
|
assert File.exist?("homebrew.txt.minisig")
|
2015-07-14 01:01:33 +00:00
|
|
|
end
|
|
|
|
end
|