homebrew-core/Formula/curl.rb

69 lines
1.8 KiB
Ruby

class Curl < Formula
desc "Get a file from an HTTP, HTTPS or FTP server"
homepage "https://curl.haxx.se/"
url "https://curl.haxx.se/download/curl-7.73.0.tar.bz2"
sha256 "cf34fe0b07b800f1c01a499a6e8b2af548f6d0e044dca4a29d88a4bee146d131"
license "curl"
livecheck do
url "https://curl.haxx.se/download/"
regex(/href=.*?curl[._-]v?(.*?)\.t/i)
end
bottle do
cellar :any
sha256 "98f3bd49f4eae8638edc391afdbc57433d81e749e310a069d670e12f5941a4ce" => :catalina
sha256 "dc41d1f29bc7d8b7c89b3526a426cdab854e8d56b4c686d187e4995adbd092e3" => :mojave
sha256 "ec6ba585b8bbcb5c17feb51efcf8df1048318368376bd7142b6a047374c010e5" => :high_sierra
end
head do
url "https://github.com/curl/curl.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
keg_only :provided_by_macos
depends_on "pkg-config" => :build
uses_from_macos "zlib"
on_linux do
depends_on "openssl@1.1"
end
def install
system "./buildconf" if build.head?
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--with-secure-transport
--without-ca-bundle
--without-ca-path
]
system "./configure", *args
system "make", "install"
system "make", "install", "-C", "scripts"
libexec.install "lib/mk-ca-bundle.pl"
end
test do
# Fetch the curl tarball and see that the checksum matches.
# This requires a network connection, but so does Homebrew in general.
filename = (testpath/"test.tar.gz")
system "#{bin}/curl", "-L", stable.url, "-o", filename
filename.verify_checksum stable.checksum
system libexec/"mk-ca-bundle.pl", "test.pem"
assert_predicate testpath/"test.pem", :exist?
assert_predicate testpath/"certdata.txt", :exist?
end
end