homebrew-core/Formula/bash-completion.rb

35 lines
1.2 KiB
Ruby
Raw Normal View History

require 'formula'
2009-09-03 06:10:36 +00:00
2011-03-10 05:11:03 +00:00
class BashCompletion < Formula
url 'http://bash-completion.alioth.debian.org/files/bash-completion-1.3.tar.bz2'
2010-07-05 05:25:54 +00:00
homepage 'http://bash-completion.alioth.debian.org/'
md5 'a1262659b4bbf44dc9e59d034de505ec'
2010-07-05 05:25:54 +00:00
head 'git://git.debian.org/git/bash-completion/bash-completion.git'
2009-09-03 06:10:36 +00:00
def install
inreplace "bash_completion" do |s|
s.gsub! '/etc/bash_completion', "#{etc}/bash_completion"
s.gsub! 'readlink -f', "readlink"
end
2009-09-03 06:10:36 +00:00
system "./configure", "--prefix=#{prefix}"
system "make install"
# Cause the build to fails if you haven't already installed git or something else that
# creates a bash_completion.d
# ln_s "#{HOMEBREW_PREFIX}/Library/Contributions/brew_bash_completion.sh", "#{etc}/bash_completion.d" unless
# File.exists? "#{etc}/bash_completion.d/brew_bash_completion.sh" or File.symlink? "#{etc}/bash_completion.d/brew_bash_completion.sh"
2009-09-03 06:10:36 +00:00
end
def caveats; <<-EOS
Add the following lines to your ~/.bash_profile file:
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
To install Homebrew's own completion script:
ln "#{HOMEBREW_PREFIX}/Library/Contributions/brew_bash_completion.sh", "#{etc}/bash_completion.d"
2009-09-03 06:10:36 +00:00
EOS
end
end