2014-10-27 19:47:21 +00:00
|
|
|
class Sslmate < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Buy SSL certs from the command-line"
|
2014-10-27 19:47:21 +00:00
|
|
|
homepage "https://sslmate.com"
|
2015-09-22 17:59:23 +00:00
|
|
|
url "https://packages.sslmate.com/other/sslmate-1.5.0.tar.gz"
|
|
|
|
sha256 "8ff98393de04d18b1b0b36dec3dd9adb48ba253278431d4de48a70ce9b9fadef"
|
2014-10-27 19:47:21 +00:00
|
|
|
|
2014-11-06 01:30:14 +00:00
|
|
|
bottle do
|
2015-09-23 10:07:34 +00:00
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "6f54f953b408f8e7b8bed0f90e999da84291d96a506053a9c0c59c30d3141611" => :el_capitan
|
|
|
|
sha256 "e60172537a652a4f4e1075c84a0a5663089f1f00ae469e222122588865038fa4" => :yosemite
|
|
|
|
sha256 "ae11a4cf8d04e4ecf85440ea0c006ab2db9394f52825082bcb021d05496e1ce7" => :mavericks
|
2014-11-06 01:30:14 +00:00
|
|
|
end
|
|
|
|
|
2015-04-20 19:25:32 +00:00
|
|
|
option "without-route53", "Disable support for Route 53 DNS approval"
|
|
|
|
|
2014-10-28 08:24:55 +00:00
|
|
|
if MacOS.version <= :snow_leopard
|
|
|
|
depends_on "perl"
|
|
|
|
depends_on "curl"
|
|
|
|
|
|
|
|
resource "URI" do
|
2015-06-16 06:04:56 +00:00
|
|
|
url "http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/URI-1.67.tar.gz"
|
|
|
|
mirror "https://cpan.metacpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz"
|
2015-05-08 11:12:06 +00:00
|
|
|
sha256 "ab7f5fbc80da4ed9c46d63ed956c68a09e83dae30f20c2778c3e056d41883f9d"
|
2014-10-28 08:24:55 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "Term::ReadKey" do
|
|
|
|
url "http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.32.tar.gz"
|
2015-05-07 18:01:39 +00:00
|
|
|
mirror "https://cpan.metacpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.32.tar.gz"
|
|
|
|
sha256 "58b90e8908e686d03a161590c1dd870e8a1b005715ca8e6d5080a32459e1e9f8"
|
2014-10-28 08:24:55 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if MacOS.version <= :mountain_lion
|
|
|
|
resource "JSON::PP" do
|
|
|
|
url "http://search.cpan.org/CPAN/authors/id/M/MA/MAKAMAKA/JSON-PP-2.27300.tar.gz"
|
2015-05-07 18:01:39 +00:00
|
|
|
mirror "https://cpan.metacpan.org/authors/id/M/MA/MAKAMAKA/JSON-PP-2.27300.tar.gz"
|
|
|
|
sha256 "5feef3067be4acd99ca0ebb29cf1ac1cdb338fe46977585bd1e473ea4bab71a3"
|
2014-10-28 08:24:55 +00:00
|
|
|
end
|
|
|
|
end
|
2014-10-27 19:47:21 +00:00
|
|
|
|
2015-04-20 19:25:32 +00:00
|
|
|
if build.with? "route53"
|
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
|
|
|
|
resource "boto" do
|
2015-06-16 06:04:56 +00:00
|
|
|
url "https://pypi.python.org/packages/source/b/boto/boto-2.38.0.tar.gz"
|
|
|
|
sha256 "d9083f91e21df850c813b38358dc83df16d7f253180a1344ecfedce24213ecf2"
|
2015-04-20 19:25:32 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-10-27 19:47:21 +00:00
|
|
|
def install
|
|
|
|
if MacOS.version <= :snow_leopard
|
|
|
|
ENV.prepend_path "PATH", Formula["perl"].bin
|
|
|
|
end
|
2015-04-20 19:25:32 +00:00
|
|
|
ENV.prepend_create_path "PERL5LIB", libexec + "vendor/lib/perl5"
|
|
|
|
ENV.prepend_create_path "PYTHONPATH", libexec + "vendor/lib/python2.7/site-packages" if build.with? "route53"
|
2014-10-27 19:47:21 +00:00
|
|
|
|
2015-04-20 19:25:32 +00:00
|
|
|
perl_resources = []
|
|
|
|
perl_resources << "URI" << "Term::ReadKey" if MacOS.version <= :snow_leopard
|
|
|
|
perl_resources << "JSON::PP" if MacOS.version <= :mountain_lion
|
|
|
|
perl_resources.each do |r|
|
|
|
|
resource(r).stage do
|
|
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}/vendor"
|
2014-10-27 19:47:21 +00:00
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-20 19:25:32 +00:00
|
|
|
python_resources = []
|
|
|
|
python_resources << "boto" if build.with? "route53"
|
|
|
|
python_resources.each do |r|
|
|
|
|
resource(r).stage do
|
|
|
|
system "python", *Language::Python.setup_install_args(libexec + "vendor")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
system "make", "PREFIX=#{prefix}"
|
|
|
|
system "make", "install", "PREFIX=#{prefix}"
|
2014-10-28 08:24:55 +00:00
|
|
|
|
|
|
|
env = { :PERL5LIB => ENV["PERL5LIB"] }
|
2014-10-27 19:47:21 +00:00
|
|
|
if MacOS.version <= :snow_leopard
|
2014-10-28 08:24:55 +00:00
|
|
|
env[:PATH] = "#{Formula["perl"].bin}:#{Formula["curl"].bin}:$PATH"
|
2014-10-27 19:47:21 +00:00
|
|
|
end
|
2015-04-20 19:25:32 +00:00
|
|
|
env[:PYTHONPATH] = ENV["PYTHONPATH"] if build.with? "route53"
|
2014-10-28 08:24:55 +00:00
|
|
|
bin.env_script_all_files(libexec + "bin", env)
|
2014-10-27 19:47:21 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/sslmate", "req", "www.example.com"
|
|
|
|
# Make sure well-formed files were generated:
|
|
|
|
system "openssl", "rsa", "-in", "www.example.com.key", "-noout"
|
|
|
|
system "openssl", "req", "-in", "www.example.com.csr", "-noout"
|
|
|
|
# The version command tests the HTTP client:
|
|
|
|
system "#{bin}/sslmate", "version"
|
|
|
|
end
|
|
|
|
end
|