Skip to content

Instantly share code, notes, and snippets.

@lepture
Last active September 7, 2017 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lepture/bbcc321885e1111ce1de1c89b0501a1d to your computer and use it in GitHub Desktop.
Save lepture/bbcc321885e1111ce1de1c89b0501a1d to your computer and use it in GitHub Desktop.
Homebrew brew formula for Varnish'es Hitch TLS Proxy Server
class Hitch < Formula
desc "A scalable TLS proxy by Varnish Software"
homepage "https://github.com/varnish/hitch"
url "https://github.com/varnish/hitch/archive/hitch-1.4.6.tar.gz"
sha256 "fecc0604a2574e50e99573536eade96769b3435aa787d2095ed9115434a6f003"
head "https://github.com/varnish/hitch.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "pkg-config" => :build
depends_on "libev"
depends_on "openssl"
option "with-session-cache", "Enable session cache support"
resource "ebtree" do
url "https://github.com/haproxy/ebtree.git"
end if build.with? "session-cache"
def install
ssl = Formula["openssl"]
system "./bootstrap"
cfg_opts = [ "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"CFLAGS=-I#{ssl.opt_include}",
"LDFLAGS=-L#{ssl.opt_lib}" ]
if build.with? "session-cache"
src_ebtree = File.join(Dir.pwd, 'src', 'ebtree')
resource("ebtree").stage do
system "cp -a '#{Dir.pwd}' '#{src_ebtree}'"
end
cfg_opts << "--enable-sessioncache"
end
system(*(%w[./configure] + cfg_opts))
system "make", "install"
end
test do
system "hitch --help"
end
end
@lepture
Copy link
Author

lepture commented Sep 7, 2017

brew install https://gist.githubusercontent.com/lepture/bbcc321885e1111ce1de1c89b0501a1d/raw/hitch.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment