64 lines
2.4 KiB
Ruby
64 lines
2.4 KiB
Ruby
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.09.tar.gz"
|
|
sha256 "acfc33d3132b68c4c7919f9999402b6aa42d49d01b3e7dd23c4baab03529ebf6"
|
|
head "https://github.com/get-iplayer/get_iplayer.git", :branch => "develop"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "a75e441eb9023faecef7d45c9503c8bca38b9dc7ccf919091214d1a69c0f9408" => :high_sierra
|
|
sha256 "3a2606df6fe2faad107b7ede811f065a84f246901d816053e5ff4ac576c43fd3" => :sierra
|
|
sha256 "c581aa784c34a8649ac4e8a389de0cb15236049f78f3f0685c4021ec2c52796b" => :el_capitan
|
|
end
|
|
|
|
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 "IO::Socket::SSL" do
|
|
url "https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.052.tar.gz"
|
|
sha256 "e4897a9b17cb18a3c44aa683980d52cef534cdfcb8063d6877c879bfa2f26673"
|
|
end
|
|
|
|
resource "Mojolicious" do
|
|
url "https://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-7.59.tar.gz"
|
|
sha256 "30a3637ac8502afeb8def3738d779de9cd0d346f0a52b8a00a2948a756769087"
|
|
end
|
|
|
|
def install
|
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
|
ENV["NO_NETWORK_TESTING"] = "1"
|
|
|
|
resources.each do |r|
|
|
r.stage do
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
|
|
system "make", "install"
|
|
end
|
|
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
|
|
|
|
bin.install "get_iplayer", "get_iplayer.cgi"
|
|
bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"])
|
|
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: Indexing tv programmes (concurrent)", output,
|
|
"Mojolicious not found"
|
|
end
|
|
end
|