homebrew-core/Formula/strongswan.rb
2018-08-22 22:15:09 +02:00

105 lines
2.8 KiB
Ruby

class Strongswan < Formula
desc "VPN based on IPsec"
homepage "https://www.strongswan.org"
url "https://download.strongswan.org/strongswan-5.6.3.tar.bz2"
sha256 "c3c7dc8201f40625bba92ffd32eb602a8909210d8b3fac4d214c737ce079bf24"
bottle do
sha256 "42a97ee1056200cba159bfd23c90b5b3f81c9d51acead0de2191f2eadb758867" => :mojave
sha256 "c333663d47d78e2d798f5c4781a9a03cb2d1ce12fede69e9e7d3480956b34e49" => :high_sierra
sha256 "dd82c36ea4e2b80af822ecc84600906a95cf37ada8323fb13578bcfd2b81e2b7" => :sierra
sha256 "52f314ba14ecae1761c57bf1fe6f261118de02f2c1075bbc6ad12ef31afb90d6" => :el_capitan
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-curve25519
--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", "check"
system "make", "install"
end
def caveats
msg = <<~EOS
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
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
test do
system "#{bin}/ipsec", "--version"
system "#{bin}/charon-cmd", "--version"
end
end