I'm trying to automate the installation of Apache Nutch by writing a Homebrew formula. The official tutorial requires users to download a TAR.GZ / ZIP from a mirror, extract, cd, run ant runtime, and finally, get the binaries into PATH. That's a pain to do over and over, so I'm trying to write a Homebrew formula to automate this for fellow Mac users. The trouble is, my formula isn't working for some reason.

When I run brew install nutch --verbose, the build process appears to succeed, but the runtime/ directory is missing from the Cellar, resulting in a failed brew test nutch.

Could someone help me debug my nutch.rb install formula?

require 'formula'

class Nutch < Formula
  homepage 'http://nutch.apache.org/'
  url 'http://mirror.reverse.net/pub/apache/nutch/2.2.1/apache-nutch-2.2.1-src.tar.gz'
  sha1 'c5d5d535a87d518aad41e89047c1eeb4331b74d2'

  def install
    system "ant runtime"
    prefix.install Dir['runtime/']
    bin.install_symlink prefix/'runtime/local/bin/nutch'

  test do
    system "#{bin}/nutch", "parsechecker", "http://nutch.apache.org/"

You must log in to answer this question.

Browse other questions tagged .