Skip to content

Instantly share code, notes, and snippets.

@wallrat
Created October 29, 2016 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wallrat/6f9e547983d29375861a864098a8559c to your computer and use it in GitHub Desktop.
Save wallrat/6f9e547983d29375861a864098a8559c 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.3.0-beta2.tar.gz"
sha256 "fbec6197a77c54f23e941cf0fcecbb8f6c24086ebe2c45467d30b330a370fe90"
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",
"--without-rst2man",
"--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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment