forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnutls34.rb
84 lines (70 loc) · 2.4 KB
/
gnutls34.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
# This formula tracks GnuTLS stable-next. This is currently the 3.4.x branch.
class Gnutls34 < Formula
homepage "http://gnutls.org"
url "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.5.tar.xz"
mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.4/gnutls-3.4.5.tar.xz"
sha256 "af88b8e0460728d034ff3f454f7851a09b7f0959a93531b6f8d35658ef0f7aae"
bottle do
cellar :any
sha256 "30f3453447fc6f4851a42d444aaa18a2d2711af294a5f0b02ae5552d8573cb18" => :yosemite
sha256 "27e42b369dd48e7f9efde2eaba9d226cdbedea39221fff7a028f81dea1dabb49" => :mavericks
sha256 "2016e94ef9a5ebbfd10ce9afac4965afd78197cccfe9e9fb9e82048af2d3222d" => :mountain_lion
end
depends_on "pkg-config" => :build
depends_on "autogen"
depends_on "libtasn1"
depends_on "gmp"
depends_on "nettle3"
depends_on "guile" => :optional
depends_on "unbound" => :optional
depends_on "libidn" => :optional
keg_only "Conflicts with GnuTLS in main repository and is not API compatible."
fails_with :llvm do
build 2326
cause "Undefined symbols when linking"
end
def install
args = %W[
--disable-dependency-tracking
--disable-silent-rules
--disable-static
--prefix=#{prefix}
--sysconfdir=#{etc}/gnutls34
--with-default-trust-store-file=#{etc}/openssl/cert.pem
--disable-heartbeat-support
--without-p11-kit
]
if build.with? "guile"
args << "--enable-guile"
args << "--with-guile-site-dir=no"
end
system "./configure", *args
system "make", "install"
# certtool shadows the OS X certtool utility
mv bin/"certtool", bin/"gnutls-certtool"
mv man1/"certtool.1", man1/"gnutls-certtool.1"
end
def post_install
keychains = %w[
/Library/Keychains/System.keychain
/System/Library/Keychains/SystemRootCertificates.keychain
]
certs_list = `security find-certificate -a -p #{keychains.join(" ")}`
certs = certs_list.scan(
/-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m
)
valid_certs = certs.select do |cert|
IO.popen("openssl x509 -inform pem -checkend 0 -noout", "w") do |openssl_io|
openssl_io.write(cert)
openssl_io.close_write
end
$?.success?
end
openssldir = etc/"openssl"
openssldir.mkpath
(openssldir/"cert.pem").atomic_write(valid_certs.join("\n"))
end
test do
system bin/"gnutls-cli", "--version"
end
end