class Strongswan < Formula desc "VPN based on IPsec" homepage "https://www.strongswan.org" url "https://download.strongswan.org/strongswan-5.3.3.tar.bz2" sha256 "39d2e8f572a57a77dda8dd8bdaf2ee47ad3cefeb86bbb840d594aa75f00f33e2" bottle do sha256 "8e8362e1186bd840387c072baff610e6e5903aa21add508ef43f5ed20963c918" => :el_capitan sha256 "74b6831a6b2cc79023d64de1bc34860d4a05930ac436980b34e7ea48c450693d" => :yosemite sha256 "9798290ab105adbd94e3d17063d17e540fb2da899b04bddebd90d117970730ce" => :mavericks end head do url "https://git.strongswan.org/strongswan.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "gettext" => :build depends_on "bison" => :build end option "with-curl", "Build with libcurl based fetcher" option "with-suite-b", "Build with Suite B support (does not use the IPsec implementation provided by the kernel)" depends_on "openssl" depends_on "curl" => :optional def install args = %W[ --disable-dependency-tracking --prefix=#{prefix} --sbindir=#{bin} --sysconfdir=#{etc} --disable-defaults --enable-charon --enable-cmd --enable-constraints --enable-eap-gtc --enable-eap-identity --enable-eap-md5 --enable-eap-mschapv2 --enable-ikev1 --enable-ikev2 --enable-kernel-pfroute --enable-nonce --enable-openssl --enable-osx-attr --enable-pem --enable-pgp --enable-pkcs1 --enable-pkcs8 --enable-pki --enable-pubkey --enable-revocation --enable-scepclient --enable-socket-default --enable-sshkey --enable-stroke --enable-swanctl --enable-unity --enable-updown --enable-x509 --enable-xauth-generic ] args << "--enable-curl" if build.with? "curl" if build.with? "suite-b" args << "--enable-kernel-libipsec" else args << "--enable-kernel-pfkey" end system "./autogen.sh" if build.head? system "./configure", *args system "make", "install" end def caveats msg = <<-EOS.undent strongSwan's configuration files are placed in: #{etc} You will have to run both "ipsec" and "charon-cmd" with "sudo". EOS if build.with? "suite-b" msg += <<-EOS.undent If you previously ran strongSwan without Suite B support it might be required to execute "sudo sysctl -w net.inet.ipsec.esp_port=0" in order to receive packets. EOS end msg end end