aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libssh2.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/libssh2.rb')
-rw-r--r--Library/Formula/libssh2.rb29
1 files changed, 20 insertions, 9 deletions
diff --git a/Library/Formula/libssh2.rb b/Library/Formula/libssh2.rb
index c89a34b48..c088cebb8 100644
--- a/Library/Formula/libssh2.rb
+++ b/Library/Formula/libssh2.rb
@@ -1,4 +1,4 @@
-require 'formula'
+require "formula"
class Libssh2 < Formula
homepage "http://www.libssh2.org/"
@@ -6,6 +6,8 @@ class Libssh2 < Formula
sha1 "c27ca83e1ffeeac03be98b6eef54448701e044b0"
revision 1
+ option "with-libressl", "build with LibreSSL instead of OpenSSL"
+
head do
url "git://git.libssh2.org/libssh2.git"
@@ -22,16 +24,25 @@ class Libssh2 < Formula
sha1 "6de15a0a9400554c51858092e0276bb9ddd15c42" => :mountain_lion
end
- depends_on "openssl"
+ depends_on "openssl" => :recommended
+ depends_on "libressl" => :optional
def install
+ args = [ "--prefix=#{prefix}",
+ "--disable-debug",
+ "--disable-dependency-tracking",
+ "--with-openssl",
+ "--with-libz"
+ ]
+
+ if build.with? "libressl"
+ args << "--with-libssl-prefix=#{Formula["libressl"].opt_prefix}"
+ else
+ args << "--with-libssl-prefix=#{Formula["openssl"].opt_prefix}"
+ end
+
system "./buildconf" if build.head?
- system "./configure", "--prefix=#{prefix}",
- "--disable-debug",
- "--disable-dependency-tracking",
- "--with-openssl",
- "--with-libssl-prefix=#{Formula['openssl'].opt_prefix}",
- "--with-libz"
- system "make install"
+ system "./configure", *args
+ system "make", "install"
end
end