Skip to content

Instantly share code, notes, and snippets.

@gaahrdner
Created May 2, 2012 02:40
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 gaahrdner/2573210 to your computer and use it in GitHub Desktop.
Save gaahrdner/2573210 to your computer and use it in GitHub Desktop.
openconnect 3.18. homebrew formulae
require 'formula'
class Openconnect < Formula
url 'ftp://ftp.infradead.org/pub/openconnect/openconnect-3.18.tar.gz'
homepage 'http://www.infradead.org/openconnect.html'
md5 '5a440ad946cfec0f1ee7ee5519081cf1'
depends_on 'pkg-config' => :build
depends_on 'gettext' => :build
def install
args = ["--prefix=#{prefix}"]
if which_vpnc
args << "--with-vpnc-script=#{which_vpnc}"
else
get_vpnc_script
args << "--with-vpnc-script=#{HOMEBREW_PREFIX}/bin/vpnc-script"
end
system "./configure", *args
system "make install"
end
def options
[["--with-vpnc-script=</full/path/to/vpnc-script>", 'Location of the vpnc script']]
end
def get_vpnc_script
curl "http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob_plain/HEAD:/vpnc-script",
"-o",
"#{HOMEBREW_PREFIX}/bin/vpnc-script"
chmod 0755, "#{HOMEBREW_PREFIX}/bin/vpnc-script"
end
def which_vpnc
ARGV.each do |a|
if a.index('--with-vpnc-script')
return a.sub('--with-vpnc-script=', '')
end
end
return false
end
def caveats; <<-EOS
OpenConnect requires you to install the Mac OS X tun/tap driver.
Get it here:
http://tuntaposx.sourceforge.net/
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment