class Pass < Formula desc "Password manager" homepage "https://www.passwordstore.org/" url "https://git.zx2c4.com/password-store/snapshot/password-store-1.7.2.tar.xz" sha256 "4768c5e1965c4d2aeb28818681e484fb105b6f46cbd75a97608615c4ec6980ea" head "https://git.zx2c4.com/password-store", :using => :git bottle do cellar :any_skip_relocation sha256 "a2bf83b71ce976cc0e8af7df62266645931a9a142140e3e13a43ff38df4a3604" => :mojave sha256 "268b81c3a5a7c7dd6ee63ed1b466e6e7b5bb6f26f21c7ac8b7a9bc860a2b2bd8" => :high_sierra sha256 "268b81c3a5a7c7dd6ee63ed1b466e6e7b5bb6f26f21c7ac8b7a9bc860a2b2bd8" => :sierra sha256 "268b81c3a5a7c7dd6ee63ed1b466e6e7b5bb6f26f21c7ac8b7a9bc860a2b2bd8" => :el_capitan end depends_on "qrencode" depends_on "tree" depends_on "gnu-getopt" depends_on "gnupg" def install system "make", "PREFIX=#{prefix}", "WITH_ALLCOMP=yes", "BASHCOMPDIR=#{bash_completion}", "ZSHCOMPDIR=#{zsh_completion}", "FISHCOMPDIR=#{fish_completion}", "install" elisp.install "contrib/emacs/password-store.el" pkgshare.install "contrib" end test do (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/"pass", "init", "Testing" system bin/"pass", "generate", "Email/testing@foo.bar", "15" assert_predicate testpath/".password-store/Email/testing@foo.bar.gpg", :exist? ensure system Formula["gnupg"].opt_bin/"gpgconf", "--kill", "gpg-agent" end end end