diff options
| author | Max Howell | 2009-10-03 15:23:28 +0100 |
|---|---|---|
| committer | Max Howell | 2009-10-03 15:23:45 +0100 |
| commit | fa93e72995f0f7c50e5319200920f3460b4b6dfa (patch) | |
| tree | a8a38cf8fa3aa118a74675f37bfc39dba10f6202 /Library | |
| parent | 725a699bff499b722032ebada93de3933565ad70 (diff) | |
| download | homebrew-fa93e72995f0f7c50e5319200920f3460b4b6dfa.tar.bz2 | |
Modernise the GRC formula somewhat
This was one of the first ones I wrote, so it lacks some of our more recent touches.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/grc.rb | 36 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 5 |
2 files changed, 14 insertions, 27 deletions
diff --git a/Library/Formula/grc.rb b/Library/Formula/grc.rb index 368426cc3..527798214 100644 --- a/Library/Formula/grc.rb +++ b/Library/Formula/grc.rb @@ -7,44 +7,31 @@ class Grc <Formula @md5='a4814dcee965c3ff67681f6b59e6378c' def install - if ARGV.include? '--profile' - puts DATA.read - exit - end - - ohai "make" #TODO we should deprefixify since it's python and thus possible - inreplace 'grc', '/etc', prefix+'etc' - inreplace 'grc.1', '/etc', prefix+'etc' + inreplace 'grc', '/etc', etc + inreplace 'grc.1', '/etc', etc inreplace 'grcat', '/usr/local', prefix inreplace 'grcat.1', '/usr/local', prefix + + etc.install 'grc.conf' + bin.install %w[grc grcat] + (share+'grc').install Dir['conf.*'] + man1.install %w[grc.1 grcat.1] - FileUtils.mkpath prefix - Dir.chdir prefix do - FileUtils.mkpath 'bin' - FileUtils.mkpath 'share/grc' - FileUtils.mkpath 'share/man/man1' - FileUtils.mkpath 'etc' - end - - `cp -fv grc grcat #{prefix}/bin` - `cp -fv conf.* #{prefix}/share/grc` - `cp -fv grc.conf #{prefix}/etc` - `cp -fv grc.1 grcat.1 #{prefix}/share/man/man1` + (etc+'grc.bashrc').write DATA.read rescue RuntimeError end def caveats <<-EOS -grc won't work as is. One option is to add some aliases to your ~/.profile -file. Homebrew can do that for you, just execute this command: +New shell sessions will start using GRC after you run the following command: + + echo 'source "`brew --prefix`/etc/grc.bashrc"' >> ~/.bashrc - brew install grc --profile >> ~/.profile EOS end end __END__ -################################################################## >> Homebrew GRC=`which grc` if [ "$TERM" != dumb ] && [ -n GRC ] then @@ -61,4 +48,3 @@ then alias ping='colourify ping' alias traceroute='colourify /usr/sbin/traceroute' fi -################################################################## << Homebrew diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index a109f7152..8e4771cd1 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -96,10 +96,11 @@ class Formula def include; prefix+'include' end def share; prefix+'share' end - # generally we don't want these to be inside the keg + # generally we don't want var stuff inside the keg def var; HOMEBREW_PREFIX+'var' end + # configuration needs to be preserved past upgrades def etc; HOMEBREW_PREFIX+'etc' end - + # reimplement if we don't autodetect the download strategy you require def download_strategy case url |
