summaryrefslogblamecommitdiffstats
path: root/ruby-raa/FUNCTIONS
blob: e039ad1e91f258568ff138d91f91a8b8a8675781 (plain) (tree)
1
2
3
4
5
6
7
8
9



                                                                          
                                                            
                                                            

                                                            
                              

                                                              
                                  

                                                                
                                  
                             
                      
                                

                                    






                                                              

                                
              
    




                                                                          
                              
                         
                                  
                           
                               

                          
                

                                
                
    








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