require "formula" class Openconnect < Formula homepage "http://www.infradead.org/openconnect.html" url "ftp://ftp.infradead.org/pub/openconnect/openconnect-7.03.tar.gz" sha1 "2b0dff69ed67b40c2402125e6b13af336fd01dc8" bottle do sha1 "2e3cc19a4ae5d78ed0de3413cfe372e8746cbe1f" => :yosemite sha1 "73f880c3a0bcc319c4c8b2655672b38c3c603e05" => :mavericks sha1 "db877aafe2295ce5fc2c07677017de2a4f10f1fa" => :mountain_lion end head do url "git://git.infradead.org/users/dwmw2/openconnect.git", :shallow => false depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end option "with-gnutls", "Use GnuTLS instead of OpenSSL" depends_on "pkg-config" => :build depends_on "gettext" depends_on "openssl" if build.without? "gnutls" depends_on "gnutls" => :optional depends_on "oath-toolkit" => :optional depends_on "stoken" => :optional resource "vpnc-script" do url "http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob_plain/df5808b301ba767578ffbec966db3b9ff154f588:/vpnc-script" sha1 "c4cb07222ed5b6c4a52f5c094dec9933ade87344" end def install etc.install resource("vpnc-script") chmod 0755, "#{etc}/vpnc-script" if build.head? ENV["GIT_DIR"] = cached_download/".git" ENV["LIBTOOLIZE"] = "glibtoolize" system "./autogen.sh" end args = %W[ --prefix=#{prefix} --sbindir=#{bin} --localstatedir=#{var} --with-vpnc-script=#{etc}/vpnc-script ] system "./configure", *args system "make install" end end