aboutsummaryrefslogtreecommitdiffstats
path: root/Formula/grc.rb
diff options
context:
space:
mode:
authorMax Howell2009-05-21 00:04:43 +0100
committerMax Howell2009-05-21 00:04:43 +0100
commit84c5c3e5c301382ede5b1f04c7440ee9055589af (patch)
treefe8248a0b54da1dbb92693f9dca7db0c6bb56ed9 /Formula/grc.rb
parent29d85578e75170a6c0eaebda4d701b46f1acf446 (diff)
downloadbrew-0.1.tar.bz2
The core tree, and some formulae0.1
Diffstat (limited to 'Formula/grc.rb')
-rw-r--r--Formula/grc.rb71
1 files changed, 71 insertions, 0 deletions
diff --git a/Formula/grc.rb b/Formula/grc.rb
new file mode 100644
index 000000000..32dc460fa
--- /dev/null
+++ b/Formula/grc.rb
@@ -0,0 +1,71 @@
+$:.unshift "#{File.dirname __FILE__}/../Cellar/homebrew" #rubysucks
+require 'brewkit'
+require 'FileUtils'
+
+def profile_string
+ <<-sput
+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
+ sput
+end
+
+######################################################################### ARGV
+case ARGV[0]
+ when '--profile' then
+ puts
+ puts '################################################################## >> yumports'
+ puts profile_string
+ puts '################################################################## << yumports'
+ exit 0
+end
+
+######################################################################### cook
+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'
+
+Formula.new(url, md5).brew do |prefix|
+ #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`
+
+ puts <<-sput
+We suggest you add this to your .profile in order to make grc work! :P
+
+#{profile_string}
+
+We can do this for you:
+
+ #{$0} --profile >> ~/.profile
+
+sput
+end