PageRenderTime 1697ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/Library/Formula/gnupg2.rb

https://github.com/bakotaco/homebrew
Ruby | 112 lines | 80 code | 20 blank | 12 comment | 2 complexity | 0f52a2e36a9ae5219d8bbbfccbfd6a6e MD5 | raw file
  1. require 'formula'
  2. class Gnupg2 < Formula
  3. homepage 'http://www.gnupg.org/'
  4. url 'ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.22.tar.bz2'
  5. sha1 '9ba9ee288e9bf813e0f1e25cbe06b58d3072d8b8'
  6. revision 1
  7. option '8192', 'Build with support for private keys of up to 8192 bits'
  8. depends_on 'libgpg-error'
  9. depends_on 'libgcrypt'
  10. depends_on 'libksba'
  11. depends_on 'libassuan'
  12. depends_on 'pinentry'
  13. depends_on 'pth'
  14. depends_on 'gpg-agent'
  15. depends_on 'dirmngr' => :recommended
  16. depends_on 'libusb-compat' => :recommended
  17. depends_on 'readline' => :optional
  18. # Fix hardcoded runtime data location
  19. # upstream: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;h=c3f08dc
  20. # Adjust package name to fit our scheme of packaging both gnupg 1.x and
  21. # 2.x, and gpg-agent separately, and adjust tests to fit this scheme
  22. # Fix typo that breaks compilation:
  23. # http://lists.gnupg.org/pipermail/gnupg-users/2013-May/046652.html
  24. patch :DATA
  25. def install
  26. inreplace 'g10/keygen.c', 'max=4096', 'max=8192' if build.include? '8192'
  27. (var/'run').mkpath
  28. ENV.append 'LDFLAGS', '-lresolv'
  29. ENV['gl_cv_absolute_stdint_h'] = "#{MacOS.sdk_path}/usr/include/stdint.h"
  30. agent = Formula["gpg-agent"].opt_prefix
  31. args = %W[
  32. --disable-dependency-tracking
  33. --prefix=#{prefix}
  34. --sbindir=#{bin}
  35. --enable-symcryptrun
  36. --disable-agent
  37. --with-agent-pgm=#{agent}/bin/gpg-agent
  38. --with-protect-tool-pgm=#{agent}/libexec/gpg-protect-tool
  39. ]
  40. if build.with? 'readline'
  41. args << "--with-readline=#{Formula["readline"].opt_prefix}"
  42. end
  43. system "./configure", *args
  44. system "make"
  45. system "make check"
  46. system "make install"
  47. # Conflicts with a manpage from the 1.x formula, and
  48. # gpg-zip isn't installed by this formula anyway
  49. rm man1/'gpg-zip.1'
  50. end
  51. end
  52. __END__
  53. diff --git a/common/homedir.c b/common/homedir.c
  54. index 4b03cfe..c84f26f 100644
  55. --- a/common/homedir.c
  56. +++ b/common/homedir.c
  57. @@ -472,7 +472,7 @@ dirmngr_socket_name (void)
  58. }
  59. return name;
  60. #else /*!HAVE_W32_SYSTEM*/
  61. - return "/var/run/dirmngr/socket";
  62. + return "HOMEBREW_PREFIX/var/run/dirmngr/socket";
  63. #endif /*!HAVE_W32_SYSTEM*/
  64. }
  65. diff --git a/configure b/configure
  66. index e5479af..a17a54d 100755
  67. --- a/configure
  68. +++ b/configure
  69. @@ -578,8 +578,8 @@ MFLAGS=
  70. MAKEFLAGS=
  71. # Identity of this package.
  72. -PACKAGE_NAME='gnupg'
  73. -PACKAGE_TARNAME='gnupg'
  74. +PACKAGE_NAME='gnupg2'
  75. +PACKAGE_TARNAME='gnupg2'
  76. PACKAGE_VERSION='2.0.22'
  77. PACKAGE_STRING='gnupg 2.0.22'
  78. PACKAGE_BUGREPORT='http://bugs.gnupg.org'
  79. diff --git a/tests/openpgp/Makefile.in b/tests/openpgp/Makefile.in
  80. index c9ceb2d..7044900 100644
  81. --- a/tests/openpgp/Makefile.in
  82. +++ b/tests/openpgp/Makefile.in
  83. @@ -312,11 +312,11 @@ GPG_IMPORT = ../../g10/gpg2 --homedir . \
  84. # Programs required before we can run these tests.
  85. -required_pgms = ../../g10/gpg2 ../../agent/gpg-agent \
  86. +required_pgms = ../../g10/gpg2 \
  87. ../../tools/gpg-connect-agent
  88. TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= LC_ALL=C \
  89. - ../../agent/gpg-agent --quiet --daemon sh
  90. + gpg-agent --quiet --daemon sh
  91. TESTS = version.test mds.test \
  92. decrypt.test decrypt-dsa.test \