55 lines
1.4 KiB
Ruby
55 lines
1.4 KiB
Ruby
class Libssh2 < Formula
|
|
desc "C library implementing the SSH2 protocol"
|
|
homepage "https://libssh2.org/"
|
|
url "https://libssh2.org/download/libssh2-1.8.2.tar.gz"
|
|
sha256 "088307d9f6b6c4b8c13f34602e8ff65d21c2dc4d55284dfe15d502c4ee190d67"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "f5fc8699b496fb79f4f0537dbb3ecb3e74489c6f70dfdbbb7257e2f260f40f84" => :mojave
|
|
sha256 "f551d52103201ca189afaa06372323e958f6cb3dad8fd896cccc0b8a25fd0504" => :high_sierra
|
|
sha256 "d7cd9032e591b7e3f5b39653ea437d81a4c54888ff471c635c3113ec2acef973" => :sierra
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/libssh2/libssh2.git"
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
end
|
|
|
|
depends_on "openssl"
|
|
|
|
def install
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--disable-debug
|
|
--disable-dependency-tracking
|
|
--disable-silent-rules
|
|
--disable-examples-build
|
|
--with-openssl
|
|
--with-libz
|
|
--with-libssl-prefix=#{Formula["openssl"].opt_prefix}
|
|
]
|
|
|
|
system "./buildconf" if build.head?
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~EOS
|
|
#include <libssh2.h>
|
|
|
|
int main(void)
|
|
{
|
|
libssh2_exit();
|
|
return 0;
|
|
}
|
|
EOS
|
|
|
|
system ENV.cc, "test.c", "-L#{lib}", "-lssh2", "-o", "test"
|
|
system "./test"
|
|
end
|
|
end
|