summaryrefslogtreecommitdiffstats
path: root/ruby-raa/FUNCTIONS
blob: e039ad1e91f258568ff138d91f91a8b8a8675781 (plain) (blame)
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
#-------------------------------------------------------------------------
## Default build for ruby spell.
#-------------------------------------------------------------------------
function default_build_ruby() {
  local up_spell_name=$(echo $SPELL | tr "a-z" "A-Z")     &&
  up_spell_name=$(echo $up_spell_name | tr ".-" "_")      &&
  local tempopts="${up_spell_name}_OPTS"                  &&
  OPTS="${!tempopts} $OPTS"                               &&
  if [[ -e ./setup.rb ]]; then
    ruby setup.rb config --prefix=${INSTALL_ROOT}/usr $OPTS &&
    ruby setup.rb setup
  elif [[ -e ./install.rb ]]; then
    ruby install.rb config --prefix=${INSTALL_ROOT}/usr $OPTS &&
    ruby install.rb setup
  elif [[ -e ./extconf.rb ]]; then
    ruby extconf.rb  $OPTS &&
    default_build_make
  elif [[ -e ./Makefile ]]; then
    default_build_make
  elif [[ -x ./configure.rb ]]; then
    ./configure.rb --prefix=${INSTALL_ROOT}/usr             \
                   --mandir=${INSTALL_ROOT}/usr/share/man   \
                   $OPTS                                    &&
    default_build_make
  elif [[ -x ./configure ]]; then
    default_build_configure &&
    default_build_make
  elif [[ -e ./Rakefile ]] ||
       [[ -e ./rakefile ]]; then
    rake $OPTS
  fi
}
#-------------------------------------------------------------------------
## Default install for ruby spell.
#-------------------------------------------------------------------------
function default_install_ruby() {
  if [[ -e ./setup.rb ]]; then
    ruby setup.rb install
  elif [[ -e ./install.rb ]]; then
    ruby install.rb install
  elif [[ -e ./extconf.rb ]] ||
       [[ -e ./Makefile ]]
       then
    make install
  elif [[ -e ./Rakefile ]] ||
       [[ -e ./rakefile ]]; then
    rake install
  fi
}

function default_build() {
   default_build_ruby
}
function default_install() {
   default_install_ruby
}