homebrew-core/Formula/mecab.rb
2015-08-27 20:19:00 +08:00

35 lines
1.2 KiB
Ruby

class Mecab < Formula
desc "Yet another part-of-speech and morphological analyzer"
homepage "https://taku910.github.io/mecab/"
url "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE"
version "0.996"
sha256 "e073325783135b72e666145c781bb48fada583d5224fb2490fb6c1403ba69c59"
bottle do
revision 1
sha1 "73f5e7206a4482f7ab714b0690ad3eeac7f0c9e0" => :yosemite
sha1 "530ee77a2f13cce3225abd0cd9401858219959d9" => :mavericks
sha1 "9747369cd4c0aa246e6a973c4f2e5652e174bae8" => :mountain_lion
end
conflicts_with "mecab-ko", :because => "both install mecab binaries"
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--sysconfdir=#{etc}"
system "make", "install"
# Put dic files in HOMEBREW_PREFIX/lib instead of lib
inreplace "#{bin}/mecab-config", "${exec_prefix}/lib/mecab/dic", "#{HOMEBREW_PREFIX}/lib/mecab/dic"
inreplace "#{etc}/mecabrc", "#{lib}/mecab/dic", "#{HOMEBREW_PREFIX}/lib/mecab/dic"
end
def post_install
(HOMEBREW_PREFIX/"lib/mecab/dic").mkpath
end
test do
assert_equal "#{HOMEBREW_PREFIX}/lib/mecab/dic", shell_output("#{bin}/mecab-config --dicdir").chomp
end
end