homebrew-core/Formula/tika.rb
2018-10-20 18:00:54 +10:00

28 lines
879 B
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.19.1.jar"
sha256 "7b2c6a8baf14e4974b4ba26c01e162ec78fb9fea1fc625ee4d7ca054d9778c89"
bottle :unneeded
depends_on :java => "1.7+"
resource "server" do
url "https://www.apache.org/dyn/closer.cgi?path=tika/tika-server-1.19.1.jar"
sha256 "76d607df16cd85af35d40d6a2098ed1523b6c0b9f7dad885e289121e6207c11b"
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
test do
pdf = test_fixtures("test.pdf")
assert_equal "application/pdf\n", shell_output("#{bin}/tika --detect #{pdf}")
end
end