homebrew-core/Formula/strongswan.rb

88 lines
2.2 KiB
Ruby

class Strongswan < Formula
desc "VPN based on IPsec"
homepage "https://www.strongswan.org"
url "https://download.strongswan.org/strongswan-5.9.1.tar.bz2"
sha256 "a337c9fb63d973b8440827755c784031648bf423b7114a04918b0b00fd42cafb"
livecheck do
url "https://download.strongswan.org/"
regex(/href=.*?strongswan[._-]v?(\d+(?:\.\d+)+[a-z]?)\.t/i)
end
bottle do
sha256 "963f3fbde531f92f196f0533fc6d80532d2d00161f98233af393dc3513c01bbe" => :big_sur
sha256 "5d8438b75c7f6a14fc90968cd6adf0a4bd90071568b4ded22c8fa494cc26fa5b" => :catalina
sha256 "c742593fc457f35256ff47ffa4fce347f5bd1d635320572f6ba107aa6e06b73d" => :mojave
sha256 "420d23c085cb5f125043f23239e3d3dbf9f023e825766a43c963f7be75f416a7" => :high_sierra
end
head do
url "https://git.strongswan.org/strongswan.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "gettext" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
end
depends_on "openssl@1.1"
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-pfkey
--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
]
system "./autogen.sh" if build.head?
system "./configure", *args
system "make", "install"
end
def caveats
<<~EOS
You will have to run both "ipsec" and "charon-cmd" with "sudo".
EOS
end
test do
system "#{bin}/ipsec", "--version"
system "#{bin}/charon-cmd", "--version"
end
end