forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenssh.rb
65 lines (51 loc) · 1.96 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
61
62
63
64
require 'formula'
class Openssh < Formula
homepage 'http://www.openssh.com/'
url 'http://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.2p2.tar.gz'
version '6.2p2'
sha1 'c2b4909eba6f5ec6f9f75866c202db47f3b501ba'
option 'with-brewed-openssl', 'Build with Homebrew OpenSSL instead of the system version'
depends_on 'openssl' if build.with? 'brewed-openssl'
depends_on 'ldns' => :optional
depends_on 'pkg-config' => :build if build.with? "ldns"
def patches
p = []
p << 'https://gist.github.com/metacollin/5559308/raw/96adc2d51c722a799de95e2e9f391bba24bcf371/openssh-6.2p1.patch' if build.include? 'with-keychain-support'
p
end
def install
if build.include? "with-keychain-support"
ENV.append "CPPFLAGS", "-D__APPLE_LAUNCHD__ -D__APPLE_KEYCHAIN__"
ENV.append "LDFLAGS", "-framework CoreFoundation -framework SecurityFoundation -framework Security"
end
args = %W[
--with-libedit
--with-kerberos5
--prefix=#{prefix}
--sysconfdir=#{etc}/ssh
]
args << "--with-ssl-dir=#{Formula.factory('openssl').opt_prefix}" if build.with? 'brewed-openssl'
args << "--with-ldns" if build.with? "ldns"
# Sometimes when Apple ships security update, the libraries get
# updated while the headers don't. Disable header/library version
# check when using system openssl to cope with this situation.
args << "--without-openssl-header-check" if not build.with? 'brewed-openssl'
system "./configure", *args
system "make"
system "make install"
end
def caveats
if build.include? "with-keychain-support"
<<-EOS.undent
For complete functionality, please modify:
/System/Library/LaunchAgents/org.openbsd.ssh-agent.plist
and change ProgramArugments from
/usr/bin/ssh-agent
to
/usr/local/bin/ssh-agent
After that, you can start storing private key passwords in
your OS X Keychain.
EOS
end
end
end