-
Notifications
You must be signed in to change notification settings - Fork 7
/
hpn-ssh.rb
78 lines (63 loc) · 2.61 KB
/
hpn-ssh.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
class HpnSsh < Formula
desc "OpenBSD freely-licensed SSH connectivity tools"
homepage "https://www.psc.edu/index.php/hpn-ssh"
url "https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz"
mirror "https://www.mirrorservice.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz"
version "7.5p1"
sha256 "9846e3c5fab9f0547400b4d2c017992f914222b3fd1f8eee6c7dc6bc5e59f9f0"
conflicts_with 'openssh'
# 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"
unless OS.mac?
depends_on "homebrew/dupes/libedit"
depends_on "homebrew/dupes/krb5"
end
if OS.mac?
# Both these patches are applied by Apple.
patch do
url "https://raw.githubusercontent.com/Homebrew/patches/1860b0a74/openssh/patch-sandbox-darwin.c-apple-sandbox-named-external.diff"
sha256 "d886b98f99fd27e3157b02b5b57f3fb49f43fd33806195970d4567f12be66e71"
end
patch do
url "https://raw.githubusercontent.com/Homebrew/patches/d8b2d8c2/openssh/patch-sshd.c-apple-sandbox-named-external.diff"
sha256 "3505c58bf1e584c8af92d916fe5f3f1899a6b15cc64a00ddece1dc0874b2f78f"
end
# Patch enabling High Performance SSH (hpn-ssh)
patch do
url 'https://downloads.sourceforge.net/project/hpnssh/HPN-SSH%2014v13%207.5p1/openssh-7_5_P1-hpn-KitchenSink-14.13.diff'
sha256 "c88b480a1110879d75cdfe06cc704086a8bf7ddf63bc66be6a899f9a9814e4f2"
end
end
def install
ENV.append "CPPFLAGS", "-D__APPLE_SANDBOX_NAMED_EXTERNAL__" if OS.mac?
args = %W[
--with-libedit
--with-kerberos5
--prefix=#{prefix}
--sysconfdir=#{etc}/ssh
]
args << "--with-pam" if OS.mac?
args << "--with-privsep-path=#{var}/lib/sshd" if OS.linux?
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"
# This was removed by upstream with very little announcement and has
# potential to break scripts, so recreate it for now.
# Debian have done the same thing.
bin.install_symlink bin/"ssh" => "slogin"
end
test do
assert_match "OpenSSH_#{version}-hpn", shell_output("#{bin}/ssh -V 2>&1")
end
end