aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/grc.rb
blob: 368426cc3e7f9cd48ec7632f62c09349f92d749f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'brewkit'

######################################################################### 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.3.tar.gz'
  @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 '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 install grc --profile >> ~/.profile
    EOS
  end
end

__END__
################################################################## >> 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