homebrew-core/Formula/gnupg2.rb

77 lines
2.4 KiB
Ruby
Raw Normal View History

require "formula"
class Gnupg2 < Formula
homepage "https://www.gnupg.org/"
url "ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.26.tar.bz2"
mirror "ftp://ftp.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.26.tar.bz2"
mirror "ftp://mirror.tje.me.uk/pub/mirrors/ftp.gnupg.org/gnupg/gnupg-2.0.26.tar.bz2"
sha1 "3ff5b38152c919724fd09cf2f17df704272ba192"
2014-07-01 10:48:03 +00:00
bottle do
2014-08-13 08:43:03 +00:00
sha1 "09e5e2acda47c02836d8a1b874f805bec9d9acbf" => :mavericks
sha1 "1300333cdd1c047179434370aa710a949f72be1c" => :mountain_lion
sha1 "4fecb9820b713e81271fb47499fd88c1568890e7" => :lion
2014-07-01 10:48:03 +00:00
end
option "8192", "Build with support for private keys of up to 8192 bits"
depends_on "libgpg-error"
depends_on "libgcrypt"
depends_on "libksba"
depends_on "libassuan"
depends_on "pinentry"
depends_on "pth"
depends_on "gpg-agent"
depends_on "dirmngr" => :recommended
depends_on "libusb-compat" => :recommended
depends_on "readline" => :optional
def install
2014-08-25 14:36:42 +00:00
# Adjust package name to fit our scheme of packaging both gnupg 1.x and
# 2.x, and gpg-agent separately, and adjust tests to fit this scheme
inreplace "configure" do |s|
s.gsub! "PACKAGE_NAME='gnupg'", "PACKAGE_NAME='gnupg2'"
s.gsub! "PACKAGE_TARNAME='gnupg'", "PACKAGE_TARNAME='gnupg2'"
end
inreplace "tests/openpgp/Makefile.in" do |s|
s.gsub! "required_pgms = ../../g10/gpg2 ../../agent/gpg-agent",
"required_pgms = ../../g10/gpg2"
s.gsub! "../../agent/gpg-agent --quiet --daemon sh",
"gpg-agent --quiet --daemon sh"
end
inreplace "g10/keygen.c", "max=4096", "max=8192" if build.include? "8192"
(var/"run").mkpath
ENV.append "LDFLAGS", "-lresolv"
ENV["gl_cv_absolute_stdint_h"] = "#{MacOS.sdk_path}/usr/include/stdint.h"
2014-02-25 14:29:33 +00:00
agent = Formula["gpg-agent"].opt_prefix
2013-07-31 16:28:13 +00:00
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
2013-11-15 16:51:18 +00:00
--sbindir=#{bin}
2013-07-31 16:28:13 +00:00
--enable-symcryptrun
--disable-agent
--with-agent-pgm=#{agent}/bin/gpg-agent
--with-protect-tool-pgm=#{agent}/libexec/gpg-protect-tool
2013-07-31 16:28:13 +00:00
]
if build.with? "readline"
2014-02-25 14:29:33 +00:00
args << "--with-readline=#{Formula["readline"].opt_prefix}"
2013-07-31 16:28:13 +00:00
end
system "./configure", *args
system "make"
2014-08-25 14:36:50 +00:00
system "make", "check"
system "make", "install"
# Conflicts with a manpage from the 1.x formula, and
# gpg-zip isn't installed by this formula anyway
rm man1/"gpg-zip.1"
end
end