homebrew-core/Formula/libressl.rb
2014-07-24 20:58:20 -05:00

50 lines
1.6 KiB
Ruby

require "formula"
class Libressl < Formula
homepage "http://www.libressl.org/"
url "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.0.3.tar.gz"
mirror "http://mirrors.nycbug.org/pub/OpenBSD/LibreSSL/libressl-2.0.3.tar.gz"
sha256 "dfd53b78803c25cb50083dd1f8f773a924dc31cdd9de396eeae4120c14aae2d4"
bottle do
sha1 "c24b27d8d48eaab61681e7fdf85f3e63ba7ed263" => :mavericks
sha1 "281e490788a7310d4ca62170ad185e3206ffcfd2" => :mountain_lion
sha1 "40795697ae67eb206b5e36e7864534e246eb0f47" => :lion
end
head do
url "https://github.com/libressl-portable/portable.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
end
keg_only "LibreSSL is not linked to prevent conflicts with the system OpenSSL."
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-openssldir=#{etc}/libressl",
"--with-enginesdir=#{lib}/engines"
system "make"
system "make", "check"
system "make", "install"
mkdir_p "#{etc}/libressl"
touch "#{etc}/libressl/openssl.cnf"
end
test do
(testpath/"testfile.txt").write("This is a test file")
expected_checksum = "91b7b0b1e27bfbf7bc646946f35fa972c47c2d32"
system "#{bin}/openssl", "dgst", "-sha1", "-out", "checksum.txt", "testfile.txt"
open("checksum.txt") do |f|
checksum = f.read(100).split("=").last.strip
assert_equal checksum, expected_checksum
end
end
end