Skip to content

Instantly share code, notes, and snippets.

@MisterPoppet
Created September 1, 2015 12:47
Show Gist options
  • Save MisterPoppet/c280e8f0c9f32175389c to your computer and use it in GitHub Desktop.
Save MisterPoppet/c280e8f0c9f32175389c to your computer and use it in GitHub Desktop.
OpenSSH Formula
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.1p1.tar.gz"
mirror "https://www.mirrorservice.org/pub/OpenBSD/OpenSSH/portable/openssh-7.1p1.tar.gz"
version "7.1p1"
sha256 "fc0a6d2d1d063d5c66dffd952493d0cda256cad204f681de0f84ef85b2ad8428"
bottle do
sha256 "503dc3735753255450915a7c7f6774546e67525df0e574d1418938e415663a25" => :yosemite
sha256 "70364317d397e7b8bc699f19fffea8a3e4c44e2d60d86642d04cc2f668d5c2fb" => :mavericks
sha256 "5d8f5195bd8f5a0d96f6991a1696b01143710666a64f6c4b0030501178818943" => :mountain_lion
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"
patch do
url "https://gist.githubusercontent.com/jacknagel/e4d68a979dca7f968bdb/raw/f07f00f9d5e4eafcba42cc0be44a47b6e1a8dd2a/sandbox.diff"
sha256 "82c287053eed12ce064f0b180eac2ae995a2b97c6cc38ad1bdd7626016204205"
end
# Patch for SSH tunnelling issues caused by launchd changes on Yosemite
patch do
url "https://raw.githubusercontent.com/DomT4/scripts/c24f29528/Homebrew_Resources/MacPorts_Import/OpenSSH/r138238/launchd.patch"
mirror "https://trac.macports.org/export/138238/trunk/dports/net/openssh/files/launchd.patch"
sha256 "012ee24bf0265dedd5bfd2745cf8262c3240a6d70edcd555e5b35f99ed070590"
end
def install
ENV.append "CPPFLAGS", "-D__APPLE_SANDBOX_NAMED_EXTERNAL__"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment