2017-06-08 18:21:12 +00:00
|
|
|
class GetIplayer < Formula
|
|
|
|
desc "Utility for downloading TV and radio programmes from BBC iPlayer"
|
|
|
|
homepage "https://github.com/get-iplayer/get_iplayer"
|
|
|
|
url "https://github.com/get-iplayer/get_iplayer/archive/v3.01.tar.gz"
|
|
|
|
sha256 "0e1e16f3706efa98893e33b1602cc00bb3d8e22e269bfc5a1a078559e4c21ce6"
|
|
|
|
head "https://github.com/get-iplayer/get_iplayer.git", :branch => "develop"
|
|
|
|
|
2017-06-08 18:26:14 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "45360cdeab5192316733a734f50f91b045c313f273b6b22bd9e71ae52a084990" => :sierra
|
|
|
|
sha256 "31763d76e946a5a4e1cafbe8dcffa3695996258ba342a6b32ff478283400c6f6" => :el_capitan
|
|
|
|
sha256 "0bcbaecb42f1558300dd45ff1b8d72faf8943a4502de0a75efeb02de3f416856" => :yosemite
|
|
|
|
end
|
|
|
|
|
2017-06-08 18:21:12 +00:00
|
|
|
depends_on "atomicparsley" => :recommended
|
|
|
|
depends_on "ffmpeg" => :recommended
|
|
|
|
|
|
|
|
depends_on :macos => :yosemite
|
|
|
|
|
|
|
|
resource "IO::Socket::IP" do
|
|
|
|
url "https://cpan.metacpan.org/authors/id/P/PE/PEVANS/IO-Socket-IP-0.39.tar.gz"
|
|
|
|
sha256 "11950da7636cb786efd3bfb5891da4c820975276bce43175214391e5c32b7b96"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "Mojolicious" do
|
|
|
|
url "https://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-7.33.tar.gz"
|
|
|
|
sha256 "3bf13d60663fc5fcfb7689ba71e0b7da2d5ac818d26b39da55f469ebb3f8fb02"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2017-06-09 08:23:53 +00:00
|
|
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
2017-06-08 18:21:12 +00:00
|
|
|
|
2017-06-09 08:23:53 +00:00
|
|
|
resources.each do |r|
|
|
|
|
r.stage do
|
|
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
2017-06-08 18:21:12 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
inreplace ["get_iplayer", "get_iplayer.cgi"] do |s|
|
|
|
|
s.gsub!(/^(my \$version_text);/i, "\\1 = \"#{pkg_version}-homebrew\";")
|
|
|
|
s.gsub! "#!/usr/bin/env perl", "#!/usr/bin/perl"
|
|
|
|
end
|
|
|
|
|
2017-06-09 08:23:53 +00:00
|
|
|
bin.install "get_iplayer", "get_iplayer.cgi"
|
|
|
|
bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"])
|
2017-06-08 18:21:12 +00:00
|
|
|
man1.install "get_iplayer.1"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
output = shell_output("\"#{bin}/get_iplayer\" --refresh --refresh-include=\"BBC None\" --quiet dontshowanymatches 2>&1")
|
|
|
|
assert_match "get_iplayer #{pkg_version}-homebrew", output, "Unexpected version"
|
|
|
|
assert_match "INFO: 0 Matching Programmes", output, "Unexpected output"
|
|
|
|
assert_match "INFO: Using concurrent indexing", output,
|
|
|
|
"Mojolicious not found"
|
|
|
|
end
|
|
|
|
end
|