forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnupg21.rb
124 lines (102 loc) · 4.18 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
121
122
123
124
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.9.tar.bz2"
mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnupg/gnupg-2.1.9.tar.bz2"
sha256 "1cb7633a57190beb66f9249cb7446603229b273d4d89331b75c652fa4a29f7b6"
bottle do
revision 1
sha256 "3c320e58e0ac25ce4536c4c0488e0293b89bf39a38b7068a0099bd51d99ac8f2" => :el_capitan
sha256 "17eb793b2e9f488177f7317f09fddb71e613db75d4070479ccb440f2875f2c53" => :yosemite
sha256 "eed4a8b01647835d2c07bcaa0a9664ab12b69e0b6718a63db32b2084217b0251" => :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 "npth"
depends_on "gnutls"
depends_on "homebrew/fuse/encfs" => :optional
depends_on "libgpg-error"
depends_on "libgcrypt"
depends_on "libksba"
depends_on "libassuan"
depends_on "pinentry"
depends_on "libusb-compat" => :recommended
depends_on "readline" => :optional
depends_on "gettext"
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
inreplace "tools/gpgkey2ssh.c", "gpg --list-keys", "gpg2 --list-keys"
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
bin.install "tools/gpgsplit" => "gpgsplit2" if build.with? "gpgsplit"
# Conflicts with a manpage from the 1.x formula, and
# gpg-zip isn't installed by this formula anyway
rm man1/"gpg-zip.1"
# Move more man conflict out of 1.x's way.
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