From 05b0685eb66dc5e63962c2fd6da8ee5b02830ed0 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Tue, 7 Jun 2016 00:48:38 +0100 Subject: [PATCH] pulledpork: vendor perl resources Throwing out to `=> :perl` is horrible, horrible UX and we can do better, so let's do so! Vendoring also means the `Crypt::SSLeay` resource can be built on OS X El Cap without messing around with PATHs, etc locally, and on older systems ensures the resource is built against an OpenSSL version actually still supported upstream. Closes #1765. Signed-off-by: Dominyk Tiller --- Formula/pulledpork.rb | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/Formula/pulledpork.rb b/Formula/pulledpork.rb index 74f7c36ee9..196d3cfd2d 100644 --- a/Formula/pulledpork.rb +++ b/Formula/pulledpork.rb @@ -3,16 +3,42 @@ class Pulledpork < Formula homepage "https://github.com/shirkdog/pulledpork" url "https://pulledpork.googlecode.com/files/pulledpork-0.7.0.tar.gz" sha256 "f60c005043850bb65a72582b9d6d68a7e7d51107f30f2b3fc67e607c995aa1a8" + revision 1 + head "https://github.com/shirkdog/pulledpork.git" - bottle :unneeded + depends_on "openssl" - depends_on "Switch" => :perl - depends_on "Crypt::SSLeay" => :perl + resource "Switch" do + url "https://cpan.metacpan.org/authors/id/C/CH/CHORNY/Switch-2.17.tar.gz" + mirror "http://search.cpan.org/CPAN/authors/id/C/CH/CHORNY/Switch-2.17.tar.gz" + sha256 "31354975140fe6235ac130a109496491ad33dd42f9c62189e23f49f75f936d75" + end + + resource "Crypt::SSLeay" do + url "https://cpan.metacpan.org/authors/id/N/NA/NANIS/Crypt-SSLeay-0.72.tar.gz" + mirror "http://search.cpan.org/CPAN/authors/id/N/NA/NANIS/Crypt-SSLeay-0.72.tar.gz" + sha256 "f5d34f813677829857cf8a0458623db45b4d9c2311daaebe446f9e01afa9ffe8" + end def install + ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5" + resources.each do |r| + r.stage do + system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}" + system "make" + system "make", "install" + end + end + + chmod 0755, "pulledpork.pl" bin.install "pulledpork.pl" + bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"]) doc.install Dir["doc/*"] - etc.install Dir["etc/*"] + (etc/"pulledpork").install Dir["etc/*"] + end + + test do + assert_match version.to_s, shell_output("#{bin}/pulledpork.pl -V") end end