class Moreutils < Formula desc "Collection of tools that nobody wrote when UNIX was young" homepage "https://joeyh.name/code/moreutils/" url "https://mirrors.ocf.berkeley.edu/debian/pool/main/m/moreutils/moreutils_0.59.orig.tar.gz" mirror "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/m/moreutils/moreutils_0.59.orig.tar.gz" sha256 "a48e11c3197bf79a7bfaa121423e64626e3381d9fedc91d606e9724ae498d1b4" head "git://git.kitenet.net/moreutils" bottle do cellar :any_skip_relocation sha256 "3623ce05999a7f2da723be974d612b5d95d32ce8ded63fee1f68c27cdf9bcf6e" => :el_capitan sha256 "90dc561597af13125ac0e4cea4aaa0e0432469fd50bbfa0a43997973c03a71c7" => :yosemite sha256 "853e7e2f98beafb8f73d2dc14b1f7fdb794f2b21c5558850f66f182b755f681f" => :mavericks end option "without-parallel", "Build without the 'parallel' tool." depends_on "docbook-xsl" => :build conflicts_with "parallel", :because => "Both install a 'parallel' executable." conflicts_with "task-spooler", :because => "Both install a 'ts' executable." resource "Time::Duration" do url "https://cpan.metacpan.org/authors/id/N/NE/NEILB/Time-Duration-1.20.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/N/NE/NEILB/Time-Duration-1.20.tar.gz" sha256 "458205b528818e741757b2854afac5f9af257f983000aae0c0b1d04b5a9cbbb8" end resource "IPC::Run" do url "https://cpan.metacpan.org/authors/id/T/TO/TODDR/IPC-Run-0.94.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/IPC-Run-0.94.tar.gz" sha256 "2eb336c91a2b7ea61f98e5b2282d91020d39a484f16041e2365ffd30f8a5605b" end def install ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5" resource("Time::Duration").stage do system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}", "--skipdeps" system "make", "install" end resource("IPC::Run").stage do system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}" system "make", "install" end inreplace "Makefile", "/usr/share/xml/docbook/stylesheet/docbook-xsl", "#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl" if build.without? "parallel" inreplace "Makefile", /^BINS=.*\Kparallel/, "" inreplace "Makefile", /^MANS=.*\Kparallel\.1/, "" end system "make", "all" system "make", "check" system "make", "install", "PREFIX=#{prefix}" bin.env_script_all_files(libexec+"bin", :PERL5LIB => ENV["PERL5LIB"]) end test do pipe_output("#{bin}/isutf8", "hello", 0) pipe_output("#{bin}/isutf8", "\xca\xc0\xbd\xe7", 1) end end