69 lines
1.8 KiB
Ruby
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.72.0.tar.bz2"
|
|
sha256 "ad91970864102a59765e20ce16216efc9d6ad381471f7accceceab7d905703ef"
|
|
license "curl"
|
|
|
|
livecheck do
|
|
url "https://curl.haxx.se/download/"
|
|
regex(/href=.*?curl[._-]v?(.*?)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "cf0b3a7fa1d1608caad2c0a9c9a8336f354e5376c827205d65cd17768dea62d8" => :catalina
|
|
sha256 "49f8082e1253de80b4178a30a3c1ea368d438139584ac4aa2b837e7568179404" => :mojave
|
|
sha256 "38ec51342cdf8105a69780cede9c6c28164d112119791d318610893ddf77e314" => :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
|