homebrew-core/Formula/mercurial.rb

38 lines
1.2 KiB
Ruby

require 'formula'
# No head build supported; if you need head builds of Mercurial, do so outside
# of Homebrew.
class Mercurial < Formula
homepage 'http://mercurial.selenic.com/'
url 'http://mercurial.selenic.com/release/mercurial-3.1.1.tar.gz'
sha1 '09cb417f55175262fcbe510af88db76bb893572e'
bottle do
cellar :any
sha1 "fb136c0649ed97c511ee89ae2b2d51919fcfd13c" => :mavericks
sha1 "642e927f4ff7b1b20257b006a5f1c259951a4db3" => :mountain_lion
sha1 "5fd44626cc90389d2890f630619341327a173d1e" => :lion
end
def install
ENV.minimal_optimization if MacOS.version <= :snow_leopard
system "make", "PREFIX=#{prefix}", "install-bin"
# Install man pages, which come pre-built in source releases
man1.install 'doc/hg.1'
man5.install 'doc/hgignore.5', 'doc/hgrc.5'
# install the completion scripts
bash_completion.install 'contrib/bash_completion' => 'hg-completion.bash'
zsh_completion.install 'contrib/zsh_completion' => '_hg'
# install the merge tool default configs
# http://mercurial.selenic.com/wiki/Packaging#Things_to_note
(etc/"mercurial"/"hgrc.d").install "contrib/mergetools.hgrc" => "mergetools.rc"
end
test do
system "#{bin}/hg", "init"
end
end