class RBT::Linux::Slackware::CreateSlackwarePackage
Constants
- ALSO_INSTALL_THE_PACKAGE
#¶ ↑
ALSO_INSTALL_THE_PACKAGE
¶ ↑#¶ ↑
- BASIC_CONFIGURE_COMMAND
#¶ ↑
BASIC_CONFIGURE_COMMAND
¶ ↑#¶ ↑
Private Class Methods
[](i = ARGV)
click to toggle source
new( name_of_the_program = return_pwd, run_already = true )
click to toggle source
#¶ ↑
initialize¶ ↑
The first argument is the name of the program.
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 66 def initialize( name_of_the_program = return_pwd, # By default we will obtain information from the current working directory. run_already = true ) reset set_name_of_the_program( name_of_the_program ) # ======================================================================= # # === Handle blocks given to this class next: # ======================================================================= # if block_given? yielded = yielded case yielded # ===================================================================== # # === :do_not_autoinstall # ===================================================================== # when :do_not_autoinstall do_not_autoinstall end end run if run_already end
Private Instance Methods
also_install_the_package?()
click to toggle source
assign_default_dataset( i = input? )
click to toggle source
#¶ ↑
assign_default_dataset
¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 362 def assign_default_dataset( i = input? ) if @use_cookbook_dataset @cookbook_dataset = RBT::Cookbooks::SanitizeCookbook.new(i) { :fast } set_program_version(@cookbook_dataset.program_version?) end end
base_directory?()
click to toggle source
#¶ ↑
base_directory?¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 223 def base_directory? @internal_hash[:base_directory] end
Also aliased as: base_dir?
cd_into_install_subdirectory()
click to toggle source
configure_options?()
click to toggle source
create_build_directory()
click to toggle source
create_install_subdirectory()
click to toggle source
dataset?()
click to toggle source
determine_base_directory()
click to toggle source
#¶ ↑
determine_base_directory
¶ ↑
The main base directory is at $MY_TEMP/build.
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 232 def determine_base_directory opne "Now determining the #{orange(':base_directory')} variable." @internal_hash[:base_directory] = convert_global_env( '$MY_TEMP/build/'+program_name_and_program_version+'/' ) # Should have a trailing '/' character. end
do_install_the_package()
click to toggle source
#¶ ↑
do_install_the_package
¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 284 def do_install_the_package _ = @location_of_the_package if File.exist? _ cd base_dir? opne 'We will next install the package, from the path' opne " #{sfile(_)}" cmd = "installpkg #{_}" esystem_gold(cmd) end end
do_not_autoinstall()
click to toggle source
enter_base_directory()
click to toggle source
generate_slack_desc_file_into_the_current_directory( i = input? )
click to toggle source
name_of_the_program?()
click to toggle source
#¶ ↑
name_of_the_program?¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 143 def name_of_the_program? @name_of_the_program end
Also aliased as: input?, program_name?
notify_the_user_how_to_install_this_package()
click to toggle source
#¶ ↑
notify_the_user_how_to_install_this_package
¶ ↑
Purpose of this method is to notify the user where the package can be found (and then installed via installpkg).
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 253 def notify_the_user_how_to_install_this_package opne 'If you wish to install this package, you can use this command:' e e simp(" installpkg #{@location_of_the_package}") e end
notify_the_user_what_we_will_install_next()
click to toggle source
prefix?()
click to toggle source
#¶ ↑
prefix?¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 434 def prefix? _ = @cookbook_dataset.prefix?.to_s if @use_cookbook_dataset # ======================================================================= # # The following condition is only true when we pass a certain # commandline flag to the class here. # ======================================================================= # if program_name? _ = programs_dir?+program_name?+'/'+program_version? end _ end
program_name_and_program_version()
click to toggle source
program_version?()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 93 def reset super() infer_the_namespace # ======================================================================= # # === :base_directory # ======================================================================= # @internal_hash[:base_directory] = nil # ======================================================================= # # === @also_install_the_package # ======================================================================= # @also_install_the_package = ALSO_INSTALL_THE_PACKAGE # ======================================================================= # # === @program_name # ======================================================================= # @program_name = nil # ======================================================================= # # === @program_version # ======================================================================= # @program_version = nil # ======================================================================= # # === @use_cookbook_dataset # ======================================================================= # @use_cookbook_dataset = true # ======================================================================= # # === @use_directory # ======================================================================= # @use_directory = false end
run()
click to toggle source
#¶ ↑
run¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 462 def run notify_the_user_what_we_will_install_next run_configure_command_into_the_inferred_prefix run_make_command # Run "make". determine_base_directory create_build_directory run_make_install_destdir_command # ======================================================================= # # Next we could run strip, but for now, we skip that. # ======================================================================= # strip_binaries create_install_subdirectory cd_into_install_subdirectory # ======================================================================= # # Next, we can generate the proper slack-desc file directly # into the current directory. # ======================================================================= # generate_slack_desc_file_into_the_current_directory enter_base_directory run_makepkg_command if also_install_the_package? do_install_the_package else notify_the_user_how_to_install_this_package end end
run_configure_command_into_the_inferred_prefix()
click to toggle source
#¶ ↑
run_configure_command_into_the_inferred_prefix
¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 410 def run_configure_command_into_the_inferred_prefix if @use_directory or @use_cookbook_dataset _ = "./configure --prefix=#{prefix?}" else _ = './'+BASIC_CONFIGURE_COMMAND end _ = _.dup _.squeeze!(' ') if @use_cookbook_dataset _ << " #{configure_options?}" end esystem_gold _ end
run_make_command()
click to toggle source
run_make_install_destdir_command()
click to toggle source
run_makepkg_command()
click to toggle source
#¶ ↑
run_makepkg_command
¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 449 def run_makepkg_command # ======================================================================= # # The following code will essentially run slackware's "makepkg" # command. # ======================================================================= # @location_of_the_package = ::RBT.run_makepkg_command( program_name?, program_version? ) end
set_name_of_the_program(i)
click to toggle source
#¶ ↑
set_name_of_the_program
¶ ↑
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 326 def set_name_of_the_program(i) if i.is_a? Array if i.empty? # Handle empty Arrays first. i = File.basename(return_pwd) else i = i.join(' ').strip.squeeze(' ') end end i = return_pwd if i.nil? # Assign a safeguard here. i = i.to_s.dup # ========================================================================= # # Chop away on '--' parts. # ========================================================================= # if i.include? '--' # ======================================================================= # # === cpackage --do-not-install # ======================================================================= # i = check_against_menu_and_chop_away_double_hyphens(i) end if i.include? '/' i = File.basename(i) end if i.include? '-' # Then grab all but the last part, through ProgramInformation. # i = i.split('-').first i = ProgramInformation[i].first end @name_of_the_program = i if @use_cookbook_dataset @cookbook_dataset = ::RBT.cookbook(@name_of_the_program) assign_default_dataset end end
set_program_name(i)
click to toggle source
set_program_version(i)
click to toggle source
show_help()
click to toggle source
#¶ ↑
show_help
(help tag)¶ ↑
Show the help options for this class.
Invocation example:
islackware --help
#¶ ↑
# File lib/rbt/linux/slackware/create_slackware_package.rb, line 132 def show_help e e ' --do-not-install # Do not run the auto-installation part.' e ' --use-directory # Use the current working directory as '\ 'base for input' e end