58 lines
2 KiB
Ruby
58 lines
2 KiB
Ruby
class Gopass < Formula
|
|
desc "The slightly more awesome Standard Unix Password Manager for Teams"
|
|
homepage "https://www.justwatch.com/gopass"
|
|
url "https://www.justwatch.com/gopass/releases/1.4.0/gopass-1.4.0.tar.gz"
|
|
sha256 "6b6476f3a1da17c789f7ed4051063e7d572e141484f66ac51f9d40b5436800e6"
|
|
head "https://github.com/justwatchcom/gopass.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "a919200dee99beddab4fdd589631cd052fc0dff942a21ea60607c32530e89a51" => :high_sierra
|
|
sha256 "c112af1643e052e921528357a58e8acb3803e68f67e49c1f365ed57be9f9fb9e" => :sierra
|
|
sha256 "ad1bdaf8e4d04c53b87231723160a8a429000036febc99670d4a69e0e5eb0ad2" => :el_capitan
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
depends_on :gpg => :run
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath
|
|
(buildpath/"src/github.com/justwatchcom/gopass").install buildpath.children
|
|
|
|
cd "src/github.com/justwatchcom/gopass" do
|
|
prefix.install_metafiles
|
|
ENV["PREFIX"] = prefix
|
|
system "make", "install"
|
|
end
|
|
|
|
output = Utils.popen_read("#{bin}/gopass completion bash")
|
|
(bash_completion/"gopass-completion").write output
|
|
end
|
|
|
|
test do
|
|
assert_match version.to_s, shell_output("#{bin}/gopass version")
|
|
|
|
(testpath/"batch.gpg").write <<-EOS.undent
|
|
Key-Type: RSA
|
|
Key-Length: 2048
|
|
Subkey-Type: RSA
|
|
Subkey-Length: 2048
|
|
Name-Real: Testing
|
|
Name-Email: testing@foo.bar
|
|
Expire-Date: 1d
|
|
%no-protection
|
|
%commit
|
|
EOS
|
|
begin
|
|
system Formula["gnupg"].opt_bin/"gpg", "--batch", "--gen-key", "batch.gpg"
|
|
|
|
system bin/"gopass", "init", "--nogit", "testing@foo.bar"
|
|
system bin/"gopass", "generate", "Email/other@foo.bar", "15"
|
|
assert File.exist?(".password-store/Email/other@foo.bar.gpg")
|
|
ensure
|
|
system Formula["gnupg"].opt_bin/"gpgconf", "--kill", "gpg-agent"
|
|
system Formula["gnupg"].opt_bin/"gpgconf", "--homedir", "keyrings/live",
|
|
"--kill", "gpg-agent"
|
|
end
|
|
end
|
|
end
|