homebrew-core/Formula/tika.rb
2018-04-24 07:16:04 -07:00

40 lines
1 KiB
Ruby

class Tika < Formula
desc "Content analysis toolkit"
homepage "https://tika.apache.org/"
url "https://www.apache.org/dyn/closer.cgi?path=tika/tika-app-1.17.jar"
sha256 "68b85b9f739507b42de54f21a6af38e56280436aa4711c309bfe53ece4cf00cc"
bottle :unneeded
depends_on :java => "1.7+"
resource "server" do
url "https://www.apache.org/dyn/closer.cgi?path=tika/tika-server-1.17.jar"
sha256 "286c693134a115ac2bf452e5f1569dfa9eb928b9658c22a147f56cf01bfb4639"
end
def install
libexec.install "tika-app-#{version}.jar"
bin.write_jar_script libexec/"tika-app-#{version}.jar", "tika"
libexec.install resource("server")
bin.write_jar_script libexec/"tika-server-#{version}.jar", "tika-rest-server"
end
def caveats; <<~EOS
To run Tika:
tika
To run Tika's REST server:
tika-rest-server
See the Tika homepage for more documentation:
brew home tika
EOS
end
test do
pdf = test_fixtures("test.pdf")
assert_equal "application/pdf\n", shell_output("#{bin}/tika --detect #{pdf}")
end
end