aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/grc.rb
diff options
context:
space:
mode:
authorMax Howell2009-06-04 19:21:19 +0100
committerMax Howell2009-06-04 19:36:58 +0100
commite91aeafc82edb2b79af67e342009cd019cd1ede5 (patch)
tree2c12888da095f544f650787ad447aa2edb94d8c1 /Library/Formula/grc.rb
parent84ad47bc3c8029847e5c41ab4646a6b9455b370a (diff)
downloadhomebrew-e91aeafc82edb2b79af67e342009cd019cd1ede5.tar.bz2
Created /Library moved brew tool to /bin
Moved Forumla and Cellar/homebrew into Library. This way the homebrew core files are more sensibly placed, Cellar is more internally consistent and only generated. And Homebrew is ready for use straight out of the tarball.
Diffstat (limited to 'Library/Formula/grc.rb')
-rw-r--r--Library/Formula/grc.rb70
1 files changed, 70 insertions, 0 deletions
diff --git a/Library/Formula/grc.rb b/Library/Formula/grc.rb
new file mode 100644
index 000000000..87a146567
--- /dev/null
+++ b/Library/Formula/grc.rb
@@ -0,0 +1,70 @@
+require 'brewkit'
+
+def profile_string
+ <<-sput
+################################################################## >> Homebrew
+GRC=`which grc`
+if [ "$TERM" != dumb ] && [ -n GRC ]
+then
+ alias colourify="$GRC -es --colour=auto"
+ alias configure='colourify ./configure'
+ alias diff='colourify diff'
+ alias make='colourify make'
+ alias gcc='colourify gcc'
+ alias g++='colourify g++'
+ alias as='colourify as'
+ alias gas='colourify gas'
+ alias ld='colourify ld'
+ alias netstat='colourify netstat'
+ alias ping='colourify ping'
+ alias traceroute='colourify /usr/sbin/traceroute'
+fi
+################################################################## << Homebrew
+ sput
+end
+
+######################################################################### ARGV
+case ARGV[0]
+ when '--profile' then
+ puts profile_string
+ exit 0
+end
+
+######################################################################### cook
+class Grc <Formula
+ @homepage='http://korpus.juls.savba.sk/~garabik/software/grc.html'
+ @url='http://korpus.juls.savba.sk/~garabik/software/grc/grc_1.1.tar.gz'
+ @md5='eeb612aba2fff14cbaf1f3bec7e1eb60'
+
+ def install
+ 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 'grcat', '/usr/local', prefix
+ inreplace 'grcat.1', '/usr/local', prefix
+
+ 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`
+ 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:
+
+ brew grc --profile >> ~/.profile
+
+ EOS
+ end
+end \ No newline at end of file