class RBT::PostinstallationStep

Constants

NAMESPACE
#

NAMESPACE

#

Public Class Methods

[](i = '') click to toggle source
#

RBT::PostinstallationStep[]

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 353
def self.[](i = '')
  self.new(i)
end
new( hash = {}, run_already = true ) { || ... } click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 30
def initialize(
    hash        = {},
    run_already = true
  )
  reset
  set_internal_hash(
    hash
  )
  if block_given?
    yielded = yield
    case yielded
    when :do_not_run_yet
      run_already = false
    end
  end
  run if run_already
end

Public Instance Methods

compile_which_program?() click to toggle source
#

compile_which_program?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 112
def compile_which_program?
  @internal_hash[:compile_which_program]
end
consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy() click to toggle source
#

consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 339
def consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy
  unless do_not_symlink?
    if is_on_roebe? and
      uses_appdir_approach? and
      no_error_has_occurred?
      target = prefix?+'lib/'
      RBT.symlink_appdir_libraries_into_usr_lib_directory(target)
    end
  end
end
cookbook_dataset?()
Alias for: dataset_to_use?
dataset?()
Alias for: dataset_to_use?
dataset_to_use?() click to toggle source
#

dataset_to_use?

Which dataset is to be used - this reader method returns that result.

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 86
def dataset_to_use?
  @internal_hash[:dataset_to_use]
end
Also aliased as: cookbook_dataset?, dataset?
delete_libtool_files?() click to toggle source
#

delete_libtool_files?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 133
def delete_libtool_files?
  @internal_hash[:delete_libtool_files]
end
do_register_the_program?() click to toggle source
#

do_register_the_program?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 119
def do_register_the_program?
  @internal_hash[:do_register_the_program]
end
do_run_fetch_all_m4_macros?() click to toggle source
#

do_run_fetch_all_m4_macros?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 140
def do_run_fetch_all_m4_macros?
  @internal_hash[:do_run_fetch_all_m4_macros]
end
ensure_that_useful_internal_values_exist() click to toggle source
#

ensure_that_useful_internal_values_exist (default tag, def tag)

This method will ensure that some default internal-values exist.

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 323
def ensure_that_useful_internal_values_exist
  unless @internal_hash.has_key? :use_tags
    @internal_hash[:use_tags] = false
  end
  unless @internal_hash.has_key? :do_register_the_program
    @internal_hash[:do_register_the_program] = true # This is the default.
  end
  unless @internal_hash.has_key? :do_run_fetch_all_m4_macros
    @internal_hash[:do_run_fetch_all_m4_macros] = true # This is the default.
  end
  @internal_hash[:symlink_program] = RBT::SymlinkThisProgram.new { :do_not_run_yet }
end
full_configure_command?() click to toggle source
#

full_configure_command?

The @full_configure_command contains the full configure command that we will use. The advantage in using this is that we can easily copy/paste this at a later time, should we need to do so.

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 98
def full_configure_command?
  @internal_hash[:full_configure_command]
end
internal_hash?() click to toggle source
#

internal_hash?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 147
def internal_hash?
  @internal_hash
end
opne(i = '') click to toggle source
#

opne

#
Calls superclass method RBT::Base#opne
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 154
def opne(i = '')
  super(i)
end
postinstall?() click to toggle source
#

postinstall?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 270
def postinstall?
  @internal_hash[:postinstall]
end
prefix?() click to toggle source
#

prefix?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 161
def prefix?
  real_prefix?.to_s
end
program_version?() click to toggle source
#

program_version?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 60
def program_version?
  _ = @internal_hash
  if _.has_key? :dataset_to_use
    _ = _[:dataset_to_use]
  end
  _ = _.internal_hash?
  _[:yaml_dataset]['program_version']
end
real_prefix?()
Alias for: use_this_prefix?
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::CompileBase#reset
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 51
def reset
  super()
  @internal_hash = {} # This Hash stores the internal dataset.
  @namespace = NAMESPACE
end
return_full_configure_command()
return_proper_prefix()
Alias for: use_this_prefix?
return_proper_prefix?()
Alias for: use_this_prefix?
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 177
def run
  prefix = real_prefix?
  # ======================================================================= #
  # Consider removing the libtool .la files next
  # ======================================================================= #
  if use_appdir_prefix?
    @internal_hash[:symlink_program].set_prefix(prefix?)
    # ===================================================================== #
    # First we must create a new 'Current' symlink:
    # ===================================================================== #
    create_a_new_current_symlink_here(real_prefix?.to_s)
    consider_removing_libtool_la_files # <- This will check whether we will remove .la files or not.
    consider_symlinking_cmake_modules
    if symlink_into_usr_lib_dir?
      RBT::SymlinkIntoUsrLibDirectory.new(
        rds(real_prefix?.to_s+'/lib/')
      )
    end
    run_post_install_class_unless_postinstall_is_empty
  end
  # ======================================================================= #
  # Eliminate stray symlinks from the /System/Tags/ directory, should
  # this directory exist.
  # ======================================================================= #
  cleanup_system_tag_directory
  # ======================================================================= #
  # Next, consider symlinking the .h files into the "/usr/include/"
  # hierarchy. This is, by default, NOT done; only some programs
  # may do so, and it will only happen for programs that are
  # installed via an AppDir way.
  # ======================================================================= #
  consider_symlinking_header_files_into_the_usr_include_hierarchy
  # ======================================================================= #
  # === Check as to whether we will instally only programs from the
  #     bin/ subdirectory. If so, we will delete the other files.
  # ======================================================================= #
  check_whether_we_will_install_only_programs_from_the_bin_subdirectory
  # ======================================================================= #
  # === The AppDir approach comes next
  #
  # If you need to tie actions related to the "/Programs/" directory
  # based installations, aka AppDirs, then this is the way to go.
  # ======================================================================= #
  if prefix.include? programs_directory?
    # ===================================================================== #
    # === Create the Architecture file on GoboLinux systems next
    # ===================================================================== #
    create_architecture_file
    create_symlinks(prefix)
    symlink_m4_macros(prefix)
    consider_symlinking_lib64_into_lib
    consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy
    register_program(prefix) # Register it into the AppDir-database.
    # ===================================================================== #
    # We next store into the "Resources/" directory, but only for
    # programs compiled via an AppDir prefix. This has to happen
    # after register_program() was called because we don't want to
    # keep track of these files in the database.
    # ===================================================================== #
    store_full_configure_command_into_resources_directory
  else
    # ===================================================================== #
    # Else we still may check for a few things, if we are on roebe that
    # is. For example, we will run the postinstallation step for bash
    # symlinking bin/bash towards bin/sh.
    # ===================================================================== #
    if is_on_roebe? and prefix.start_with?(home_dir?)
      run_post_install_class_unless_postinstall_is_empty
    end
  end
  # ======================================================================= #
  # Next, we symlink into /System/Tags.
  # ======================================================================= #
  symlink_into_tags(
    compile_which_program?,
    real_prefix?.to_s,
    cookbook_dataset?,
    use_tags?
  )
  # ======================================================================= #
  # Cleanup: We must get rid of special files.
  # ======================================================================= #
  remove_compiling_is_in_progress
  # ======================================================================= #
  # We may play a song, irrespective over as to whether we have used
  # an AppDir installation or not.
  # ======================================================================= #
  play_song if play_song?
end
run_post_install_class_unless_postinstall_is_empty() click to toggle source
#

run_post_install_class_unless_postinstall_is_empty

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 277
def run_post_install_class_unless_postinstall_is_empty
  unless postinstall?.empty?
    # ===================================================================== #
    # Delegate to class RBT::PostInstall next, but only if the
    # postinstall setting in the cookbook .yml file is NOT empty.
    # ===================================================================== #
    RBT::PostInstall.new(dataset?) {{
      use_this_compile_prefix: real_prefix?.to_s
    }}
  end
end
set_internal_hash(i = '') click to toggle source
#

set_internal_hash

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 72
def set_internal_hash(i = '')
  if i.is_a? String
    i = { compile_which_program: i }
  end
  @internal_hash = i
  ensure_that_useful_internal_values_exist
end
use_tags?() click to toggle source
#

use_tags?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 126
def use_tags?
  @internal_hash[:use_tags]
end
use_this_prefix?() click to toggle source
#

use_this_prefix?

#
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 168
def use_this_prefix?
  @internal_hash[:use_this_prefix]
end