2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-03 06:10:36 +00:00
|
|
|
|
2012-07-07 18:08:22 +00:00
|
|
|
# NOTE: version 2.0 is out, but it requires Bash 4, and OS X ships
|
2012-08-20 19:00:50 +00:00
|
|
|
# with 3.2.48. See homebrew-versions for a 2.0 formula.
|
2011-03-10 05:11:03 +00:00
|
|
|
class BashCompletion < Formula
|
2010-07-05 05:25:54 +00:00
|
|
|
homepage 'http://bash-completion.alioth.debian.org/'
|
2012-07-07 18:08:22 +00:00
|
|
|
url 'http://bash-completion.alioth.debian.org/files/bash-completion-1.3.tar.bz2'
|
|
|
|
sha1 '6a46b93f44c56cc336632ab28d90c0595fbcc98f'
|
|
|
|
|
2012-08-20 19:00:50 +00:00
|
|
|
def compdir
|
|
|
|
etc/'bash_completion.d'
|
2012-07-07 18:08:22 +00:00
|
|
|
end
|
2012-02-27 03:44:55 +00:00
|
|
|
|
2009-09-03 06:10:36 +00:00
|
|
|
def install
|
2010-09-13 15:50:14 +00:00
|
|
|
inreplace "bash_completion" do |s|
|
2012-08-20 19:00:50 +00:00
|
|
|
s.gsub! '/etc/bash_completion', etc/'bash_completion'
|
2010-09-13 16:09:36 +00:00
|
|
|
s.gsub! 'readlink -f', "readlink"
|
2010-09-13 15:50:14 +00:00
|
|
|
end
|
|
|
|
|
2012-08-20 19:00:50 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}"
|
2009-09-03 06:10:36 +00:00
|
|
|
system "make install"
|
2011-02-10 17:55:22 +00:00
|
|
|
|
2012-08-20 19:00:50 +00:00
|
|
|
unless (compdir/'brew_bash_completion.sh').exist?
|
|
|
|
compdir.install_symlink HOMEBREW_CONTRIB/'brew_bash_completion.sh'
|
|
|
|
end
|
|
|
|
end
|
2011-09-02 20:14:12 +00:00
|
|
|
|
2012-08-20 19:00:50 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Add the following lines to your ~/.bash_profile:
|
|
|
|
if [ -f $(brew --prefix)/etc/bash_completion ]; then
|
|
|
|
. $(brew --prefix)/etc/bash_completion
|
|
|
|
fi
|
2011-09-02 20:14:12 +00:00
|
|
|
|
2012-08-20 19:00:50 +00:00
|
|
|
Homebrew's own bash completion script has been installed to
|
|
|
|
#{compdir}
|
|
|
|
EOS
|
2009-09-03 06:10:36 +00:00
|
|
|
end
|
|
|
|
end
|