homebrew-core/Formula/gpg-agent.rb
2016-07-21 02:45:16 -07:00

53 lines
1.9 KiB
Ruby

# This formula tracks GnuPG stable. You can find GnuPG Modern via:
# brew install homebrew/versions/gnupg21
# At the moment GnuPG Modern causes too many incompatibilities to be in core.
class GpgAgent < Formula
desc "GPG key agent"
homepage "https://www.gnupg.org/"
url "https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.30.tar.bz2"
mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.30.tar.bz2"
sha256 "e329785a4f366ba5d72c2c678a7e388b0892ac8440c2f4e6810042123c235d71"
revision 1
bottle do
sha256 "d13f81eed299b09bb12bc3d9cb3a85af17e28662c9353c6928d90efbd01556d5" => :el_capitan
sha256 "d495205bb284b493fcc5cdbcbda32d9d9c0408532e99ce9d4f13ed6e3f74d969" => :yosemite
sha256 "cbcab34d6357423d93904bc3f80b552519291852e1bc87e3fbfb70628237f094" => :mavericks
end
depends_on "libgpg-error"
depends_on "libgcrypt"
depends_on "libksba"
depends_on "libassuan"
depends_on "pth"
depends_on "pinentry"
def install
# don't use Clang's internal stdint.h
ENV["gl_cv_absolute_stdint_h"] = "#{MacOS.sdk_path}/usr/include/stdint.h"
# Adjust package name to fit our scheme of packaging both
# gnupg 1.x and 2.x, and gpg-agent separately
inreplace "configure" do |s|
s.gsub! "PACKAGE_NAME='gnupg'", "PACKAGE_NAME='gpg-agent'"
s.gsub! "PACKAGE_TARNAME='gnupg'", "PACKAGE_TARNAME='gpg-agent'"
end
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-agent-only",
"--with-pinentry-pgm=#{Formula["pinentry"].opt_bin}/pinentry",
"--with-scdaemon-pgm=#{Formula["gnupg2"].opt_libexec}/scdaemon"
system "make", "install"
end
def caveats; <<-EOS.undent
Remember to add "use-standard-socket" to your ~/.gnupg/gpg-agent.conf
file.
EOS
end
test do
system "#{bin}/gpg-agent", "--help"
end
end