forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnupg21.rb
120 lines (99 loc) · 4.04 KB
/
gnupg21.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
class Gnupg21 < Formula
desc "GNU Privacy Guard: a free PGP replacement"
homepage "https://www.gnupg.org/"
url "https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.11.tar.bz2"
mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnupg/gnupg-2.1.11.tar.bz2"
sha256 "b7b0fb2c8c5d47d7ec916d4a1097c0ddcb94a12bb1c0ac424ad86b1ee316b61a"
bottle do
sha256 "725cb9cebd07ca0ab9ea56a5742c765b77f0eed17f7c4428b575c40eea35ac8b" => :el_capitan
sha256 "a699c10bc5324df5b88cd1612b7aa9c4b841986d7438eed542a4b59816cf41e2" => :yosemite
sha256 "8c43114c858a4975c0fd1b3b52703e2be6b4ac2d8a40fb89dd9366db425b39a0" => :mavericks
end
head do
url "git://git.gnupg.org/gnupg.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
option "with-gpgsplit", "Additionally install the gpgsplit utility"
depends_on "pkg-config" => :build
depends_on "sqlite" => :build if MacOS.version == :mavericks
depends_on "npth"
depends_on "gnutls"
depends_on "libgpg-error"
depends_on "libgcrypt"
depends_on "libksba"
depends_on "libassuan"
depends_on "pinentry"
depends_on "gettext"
depends_on "adns"
depends_on "libusb-compat" => :recommended
depends_on "readline" => :optional
depends_on "homebrew/fuse/encfs" => :optional
conflicts_with "gnupg2",
:because => "GPG2.1.x is incompatible with the 2.0.x branch."
conflicts_with "gpg-agent",
:because => "GPG2.1.x ships an internal gpg-agent which it must use."
conflicts_with "dirmngr",
:because => "GPG2.1.x ships an internal dirmngr which it it must use."
conflicts_with "fwknop",
:because => "fwknop expects to use a `gpgme` with Homebrew/Homebrew's gnupg2."
conflicts_with "gpgme",
:because => "gpgme currently requires 1.x.x or 2.0.x."
def install
(var/"run").mkpath
ENV.append "LDFLAGS", "-lresolv"
ENV["gl_cv_absolute_stdint_h"] = "#{MacOS.sdk_path}/usr/include/stdint.h"
args = %W[
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--sbindir=#{bin}
--sysconfdir=#{etc}
--enable-symcryptrun
--with-pinentry-pgm=#{Formula["pinentry"].opt_bin}/pinentry
]
args << "--with-readline=#{Formula["readline"].opt_prefix}" if build.with? "readline"
if build.head?
args << "--enable-maintainer-mode"
system "./autogen.sh", "--force"
system "automake", "--add-missing"
end
# Adjust package name to fit our scheme of packaging both gnupg 1.x and
# and 2.1.x and gpg-agent separately.
inreplace "configure" do |s|
s.gsub! "PACKAGE_NAME='gnupg'", "PACKAGE_NAME='gnupg2'"
s.gsub! "PACKAGE_TARNAME='gnupg'", "PACKAGE_TARNAME='gnupg2'"
end
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
bin.install "tools/gpgsplit" => "gpgsplit2" if build.with? "gpgsplit"
# Move man files that conflict with 1.x.
mv share/"doc/gnupg2/FAQ", share/"doc/gnupg2/FAQ21"
mv share/"doc/gnupg2/examples/gpgconf.conf", share/"doc/gnupg2/examples/gpgconf21.conf"
mv share/"info/gnupg.info", share/"info/gnupg21.info"
mv man7/"gnupg.7", man7/"gnupg21.7"
end
def caveats; <<-EOS.undent
Once you run the new gpg2 binary you will find it incredibly
difficult to go back to using `gnupg2` from Homebrew/Homebrew.
The new 2.1.x moves to a new keychain format that can't be
and won't be understood by the 2.0.x branch or lower.
If you use this `gnupg21` formula for a while and decide
you don't like it, you will lose the keys you've imported since.
For this reason, we strongly advise that you make a backup
of your `~/.gnupg` directory.
For full details of the changes, please visit:
https://www.gnupg.org/faq/whats-new-in-2.1.html
If you are upgrading to gnupg21 from gnupg2 you should execute:
`killall gpg-agent && gpg-agent --daemon`
After install. See:
https://github.com/Homebrew/homebrew-versions/issues/681
EOS
end
test do
system "#{bin}/gpgconf"
end
end