forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenssh.rb
60 lines (50 loc) · 2.1 KB
/
openssh.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
class Openssh < Formula
desc "OpenBSD freely-licensed SSH connectivity tools"
homepage "http://www.openssh.com/"
url "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.1p2.tar.gz"
mirror "https://www.mirrorservice.org/pub/OpenBSD/OpenSSH/portable/openssh-7.1p2.tar.gz"
version "7.1p2"
sha256 "dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd"
bottle do
sha256 "3cd4f668af0d8c71921b727e3303ce6a1c1fa9d110f7566277dded684de79c32" => :el_capitan
sha256 "23e68016ba5ef59e2fc49db25b78650f753e887c92b69985945e83fddb783b08" => :yosemite
sha256 "458e7e590a4e55a762d892c63e5b8c3f14515428380536787ec0d26bf247bbd6" => :mavericks
end
# Please don't resubmit the keychain patch option. It will never be accepted.
# https://github.com/Homebrew/homebrew-dupes/pull/482#issuecomment-118994372
option "with-libressl", "Build with LibreSSL instead of OpenSSL"
depends_on "openssl" => :recommended
depends_on "libressl" => :optional
depends_on "ldns" => :optional
depends_on "pkg-config" => :build if build.with? "ldns"
if OS.mac?
patch do
url "https://raw.githubusercontent.com/Homebrew/patches/1860b0a74/openssh/patch-sandbox-darwin.c-apple-sandbox-named-external.diff"
sha256 "d886b98f99fd27e3157b02b5b57f3fb49f43fd33806195970d4567f12be66e71"
end
# Patch for SSH tunnelling issues caused by launchd changes on Yosemite
patch do
url "https://raw.githubusercontent.com/Homebrew/patches/ec8d1331/OpenSSH/launchd.patch"
sha256 "012ee24bf0265dedd5bfd2745cf8262c3240a6d70edcd555e5b35f99ed070590"
end
end
def install
ENV.append "CPPFLAGS", "-D__APPLE_SANDBOX_NAMED_EXTERNAL__" if OS.mac?
args = %W[
--with-libedit
--with-pam
--with-kerberos5
--prefix=#{prefix}
--sysconfdir=#{etc}/ssh
]
if build.with? "libressl"
args << "--with-ssl-dir=#{Formula["libressl"].opt_prefix}"
else
args << "--with-ssl-dir=#{Formula["openssl"].opt_prefix}"
end
args << "--with-ldns" if build.with? "ldns"
system "./configure", *args
system "make"
system "make", "install"
end
end