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://github.com/justwatchcom/gopass/releases/download/v1.7.1/gopass-1.7.1.tar.gz"
|
|
sha256 "8505ceb4e553164bbccf38a4989b13cbefee4f7361557488b97562925a7dc14a"
|
|
head "https://github.com/justwatchcom/gopass.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "306c18f04829b561a8a04825a68d31a851914bfc761a7a4491cd2f6aca74d66e" => :high_sierra
|
|
sha256 "6816539ccbc3ea7b1b91da3297ff18c9b9abb00575120d64d6c452000041fab3" => :sierra
|
|
sha256 "620a0d432c4950231c48f6b5906deadcb7df5cf0e71345cbe4adda32b904dcc9" => :el_capitan
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
depends_on "gnupg"
|
|
|
|
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
|
|
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", "--rcs", "noop", "testing@foo.bar"
|
|
system bin/"gopass", "generate", "Email/other@foo.bar", "15"
|
|
assert_predicate testpath/".password-store/Email/other@foo.bar.gpg", :exist?
|
|
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
|