aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pass.rb
diff options
context:
space:
mode:
authorEmanuel Evans2014-10-28 13:16:59 -0700
committerMike McQuaid2014-10-31 10:00:26 +0000
commitc4e68effd2013d40931ea01d678a064edd05e652 (patch)
tree04d17cc2f801b275916712ab9b760dd31113d018 /Library/Formula/pass.rb
parent3c921d171c1cc4bf0dfadf6a427a08c13ce5f849 (diff)
downloadhomebrew-c4e68effd2013d40931ea01d678a064edd05e652.tar.bz2
pass: use any gpgtools.
The homebrew-provided version of GPG is quite difficult to configure, and Homebrew Cask provides a nice option to install GPGTools (which takes care of a lot of configuration). This changes the pass formula to skip installing the Homebrew gnupg2 package if gpg is already installed through some other method (most likely GPGTools). Closes #33684. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/pass.rb')
-rw-r--r--Library/Formula/pass.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/Library/Formula/pass.rb b/Library/Formula/pass.rb
index 082b6ea1b..23bf0abc7 100644
--- a/Library/Formula/pass.rb
+++ b/Library/Formula/pass.rb
@@ -1,5 +1,22 @@
require 'formula'
+class GpgRequirement < Requirement
+ fatal true
+ default_formula 'gnupg2'
+
+ satisfy do
+ %w(gpg gpg2).any? { |gpg| which gpg }
+ end
+
+ def message; <<-EOS.undent
+ pass requires GPG to be installed. Please install GPG in one of three ways:
+ - Install the gnupg2 package through Homebrew
+ - Install the gpgtools package through Homebrew Cask
+ - Download and install gpgtools from https://gpgtools.org/
+ EOS
+ end
+end
+
class Pass < Formula
homepage 'http://www.passwordstore.org/'
url 'http://git.zx2c4.com/password-store/snapshot/password-store-1.6.3.tar.xz'
@@ -17,7 +34,7 @@ class Pass < Formula
depends_on 'pwgen'
depends_on 'tree'
depends_on 'gnu-getopt'
- depends_on 'gnupg2'
+ depends_on GpgRequirement
def install
system "make DESTDIR=#{prefix} PREFIX=/ install"