2014-06-04 02:03:03 +00:00
|
|
|
require "formula"
|
2011-12-17 20:50:50 +00:00
|
|
|
|
|
|
|
class Gnupg2 < Formula
|
2014-06-04 02:03:03 +00:00
|
|
|
homepage "https://www.gnupg.org/"
|
2014-06-24 19:21:14 +00:00
|
|
|
url "ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.24.tar.bz2"
|
|
|
|
sha1 "010e027d5f622778cadc4c124013fe515ed705cf"
|
2011-12-17 20:50:50 +00:00
|
|
|
|
2014-06-04 02:03:03 +00:00
|
|
|
option "8192", "Build with support for private keys of up to 8192 bits"
|
2013-07-17 18:13:46 +00:00
|
|
|
|
2014-06-04 02:03:03 +00:00
|
|
|
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
|
2011-12-17 20:50:50 +00:00
|
|
|
|
2012-03-28 03:56:56 +00:00
|
|
|
# Fix hardcoded runtime data location
|
|
|
|
# upstream: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;h=c3f08dc
|
|
|
|
# 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
|
2014-03-19 17:07:51 +00:00
|
|
|
patch :DATA
|
2011-12-17 20:50:50 +00:00
|
|
|
|
|
|
|
def install
|
2014-06-04 02:03:03 +00:00
|
|
|
inreplace "g10/keygen.c", "max=4096", "max=8192" if build.include? "8192"
|
2013-07-17 18:13:46 +00:00
|
|
|
|
2014-06-04 02:03:03 +00:00
|
|
|
(var/"run").mkpath
|
2011-12-17 20:50:50 +00:00
|
|
|
|
2014-06-04 02:03:03 +00:00
|
|
|
ENV.append "LDFLAGS", "-lresolv"
|
2013-07-25 21:38:49 +00:00
|
|
|
|
2014-06-04 02:03:03 +00:00
|
|
|
ENV["gl_cv_absolute_stdint_h"] = "#{MacOS.sdk_path}/usr/include/stdint.h"
|
2011-12-17 20:50:50 +00:00
|
|
|
|
2014-02-25 14:29:33 +00:00
|
|
|
agent = Formula["gpg-agent"].opt_prefix
|
2014-01-29 16:31:29 +00:00
|
|
|
|
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
|
2014-01-29 16:31:29 +00:00
|
|
|
--with-agent-pgm=#{agent}/bin/gpg-agent
|
|
|
|
--with-protect-tool-pgm=#{agent}/libexec/gpg-protect-tool
|
2013-07-31 16:28:13 +00:00
|
|
|
]
|
|
|
|
|
2014-06-04 02:03:03 +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
|
2011-12-17 20:50:50 +00:00
|
|
|
system "make"
|
|
|
|
system "make check"
|
|
|
|
system "make install"
|
|
|
|
|
2012-03-28 03:56:56 +00:00
|
|
|
# Conflicts with a manpage from the 1.x formula, and
|
2011-12-17 20:50:50 +00:00
|
|
|
# gpg-zip isn't installed by this formula anyway
|
2014-06-04 02:03:03 +00:00
|
|
|
rm man1/"gpg-zip.1"
|
2011-12-17 20:50:50 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/common/homedir.c b/common/homedir.c
|
2013-10-05 18:14:05 +00:00
|
|
|
index 4b03cfe..c84f26f 100644
|
2011-12-17 20:50:50 +00:00
|
|
|
--- a/common/homedir.c
|
|
|
|
+++ b/common/homedir.c
|
2013-10-05 18:14:05 +00:00
|
|
|
@@ -472,7 +472,7 @@ dirmngr_socket_name (void)
|
2011-12-17 20:50:50 +00:00
|
|
|
}
|
|
|
|
return name;
|
|
|
|
#else /*!HAVE_W32_SYSTEM*/
|
|
|
|
- return "/var/run/dirmngr/socket";
|
|
|
|
+ return "HOMEBREW_PREFIX/var/run/dirmngr/socket";
|
|
|
|
#endif /*!HAVE_W32_SYSTEM*/
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/configure b/configure
|
2014-06-04 02:03:03 +00:00
|
|
|
index 5959b37..2bea995 100755
|
2011-12-17 20:50:50 +00:00
|
|
|
--- a/configure
|
|
|
|
+++ b/configure
|
2013-06-03 23:51:54 +00:00
|
|
|
@@ -578,8 +578,8 @@ MFLAGS=
|
2011-12-17 20:50:50 +00:00
|
|
|
MAKEFLAGS=
|
|
|
|
|
|
|
|
# Identity of this package.
|
|
|
|
-PACKAGE_NAME='gnupg'
|
|
|
|
-PACKAGE_TARNAME='gnupg'
|
|
|
|
+PACKAGE_NAME='gnupg2'
|
|
|
|
+PACKAGE_TARNAME='gnupg2'
|
2014-06-24 19:21:14 +00:00
|
|
|
PACKAGE_VERSION='2.0.24'
|
|
|
|
PACKAGE_STRING='gnupg 2.0.24'
|
2011-12-17 20:50:50 +00:00
|
|
|
PACKAGE_BUGREPORT='http://bugs.gnupg.org'
|
|
|
|
diff --git a/tests/openpgp/Makefile.in b/tests/openpgp/Makefile.in
|
2013-10-05 18:14:05 +00:00
|
|
|
index c9ceb2d..7044900 100644
|
2011-12-17 20:50:50 +00:00
|
|
|
--- a/tests/openpgp/Makefile.in
|
|
|
|
+++ b/tests/openpgp/Makefile.in
|
2013-10-05 18:14:05 +00:00
|
|
|
@@ -312,11 +312,11 @@ GPG_IMPORT = ../../g10/gpg2 --homedir . \
|
2011-12-17 20:50:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Programs required before we can run these tests.
|
|
|
|
-required_pgms = ../../g10/gpg2 ../../agent/gpg-agent \
|
|
|
|
+required_pgms = ../../g10/gpg2 \
|
|
|
|
../../tools/gpg-connect-agent
|
|
|
|
|
|
|
|
TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= LC_ALL=C \
|
2012-03-28 03:56:56 +00:00
|
|
|
- ../../agent/gpg-agent --quiet --daemon sh
|
|
|
|
+ gpg-agent --quiet --daemon sh
|
2011-12-17 20:50:50 +00:00
|
|
|
|
|
|
|
TESTS = version.test mds.test \
|
|
|
|
decrypt.test decrypt-dsa.test \
|