2011-12-01 06:06:44 +00:00
|
|
|
class Libssh < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "C library SSHv1/SSHv2 client and server protocols"
|
2014-10-08 02:52:26 +00:00
|
|
|
homepage "https://www.libssh.org/"
|
2015-07-05 17:21:06 +00:00
|
|
|
url "https://red.libssh.org/attachments/download/154/libssh-0.7.1.tar.xz"
|
|
|
|
sha256 "2fc7ccf96d3263cbd8ab520118cb94d9a2e11714c61e22b3f761fc5352fd046d"
|
2011-12-01 06:06:44 +00:00
|
|
|
|
2014-10-08 02:52:26 +00:00
|
|
|
head "git://git.libssh.org/projects/libssh.git"
|
|
|
|
|
2014-07-03 21:00:26 +00:00
|
|
|
bottle do
|
2015-07-06 01:56:57 +00:00
|
|
|
sha256 "d4c38799d5f43f7f19d69f5733f884604944cde5458383cf5133ce449524fada" => :yosemite
|
|
|
|
sha256 "f316f85527d2ff721eb897fff84329610241224462d396ff6afdbd0f41b7c73c" => :mavericks
|
|
|
|
sha256 "a090f18299ad75737715fb0b1dd37fff809dc10383232a65c4849f61a7197bf7" => :mountain_lion
|
2014-07-03 21:00:26 +00:00
|
|
|
end
|
|
|
|
|
2014-10-08 02:52:26 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
depends_on "openssl"
|
2011-12-01 06:06:44 +00:00
|
|
|
|
|
|
|
def install
|
2014-10-08 02:52:26 +00:00
|
|
|
mkdir "build" do
|
2012-05-22 21:37:04 +00:00
|
|
|
system "cmake", "..", *std_cmake_args
|
2014-10-08 02:52:26 +00:00
|
|
|
system "make", "install"
|
2011-12-01 06:06:44 +00:00
|
|
|
end
|
|
|
|
end
|
2014-10-12 17:25:29 +00:00
|
|
|
|
2015-07-05 17:21:06 +00:00
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <libssh/libssh.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
ssh_session my_ssh_session = ssh_new();
|
|
|
|
if (my_ssh_session == NULL)
|
|
|
|
exit(-1);
|
|
|
|
ssh_free(my_ssh_session);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "-I#{include}", "-L#{lib}", "-lssh",
|
|
|
|
testpath/"test.c", "-o", testpath/"test"
|
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|