class Cookbooks::Gobolinux::CreateRecipe
Constants
- NAMESPACE
#¶ ↑
NAMESPACE¶ ↑
#¶ ↑
- USE_THIS_GOBOLINUX_COMPILE_VERSION
#¶ ↑
USE_THIS_GOBOLINUX_COMPILE_VERSION¶ ↑
Which gobolinux-compile version to use. Currently this is hardcoded.
On GoboLinux, we could probably determine the “Compile –version”.
#¶ ↑
Public Class Methods
new( i = ARGV, run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 53 def initialize( i = ARGV, run_already = true ) reset set_this_program(i) if block_given? yielded = yield case yielded # ===================================================================== # # The following entry point means that we will store e. g. 'gtk' into # the subdirectory 'g/gtk'. # ===================================================================== # when :store_in_alphanumeric_subdirectory use_this_first_character = @this_program[0,1].dup @store_in_this_base_directory << use_this_first_character+'/' end end run if run_already end
Public Instance Methods
add(i = N)
click to toggle source
configure_options?()
click to toggle source
#¶ ↑
configure_options?¶ ↑
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 322 def configure_options? @dataset.configure_options? # This appears to be a String. end
Also aliased as: coptions?
consider_appending_more_stuff()
click to toggle source
create_directory_skeleton()
click to toggle source
#¶ ↑
#create_directory_skeleton¶ ↑
This method will create the required directories and files to accomodate a gobolinux recipe.
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 347 def create_directory_skeleton _ = temporary_base_dir?+name_of_the_program+'-'+version?+'/' mkdir _ opnn; touch rds(_+'/Recipe'), :be_verbose mkdir rds(_+'/Resources/') opnn; touch rds(_+'/Resources/BuildDependencies'), :be_verbose opnn; touch rds(_+'/Resources/BuildInformation'), :be_verbose opnn; touch rds(_+'/Resources/Dependencies'), :be_verbose opnn; touch rds(_+'/Resources/Description'), :be_verbose opnn; touch rds(_+'/Resources/Environment'), :be_verbose # This one is rarely needed. populate_description_file populate_dependencies_file populate_recipe_file # Need to fill up the file "Recipe" here. end
dataset?()
click to toggle source
dependencies?()
click to toggle source
description?()
click to toggle source
has_a_homepage_url?()
click to toggle source
homepage_url?()
click to toggle source
licence?()
click to toggle source
#¶ ↑
licence?¶ ↑
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 208 def licence? _ = @dataset.licence?.to_s # ======================================================================= # # GoboLinux uses a slightly different scheme, hence the following # line which acts as a corrective. # ======================================================================= # _ = 'GNU GPL 2' if _ == 'GPLv2' return _ end
Also aliased as: license?
notify_the_user_what_we_will_do()
click to toggle source
opnn()
click to toggle source
pad_with_quotes(i)
click to toggle source
path?()
click to toggle source
#¶ ↑
path?¶ ↑
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 194 def path? dataset?.program_path? end
Also aliased as: path
populate_dependencies_file()
click to toggle source
populate_description_file( i = program_name? )
click to toggle source
#¶ ↑
#populate_description_file¶ ↑
This method will generate a (hopefully) valid GoboLinux Recipe description file. This file resides in the subdirectory Resources/ hierarchy.
For examples of such a file in use by GoboLinux, have a look at:
http://recipes.gobolinux.org/r/?list=LibDRM&ver=2.4.80-r1&file=Resources/Description http://recipes.gobolinux.org/r/?list=ZzipLib&ver=0.13.58-r1&file=Resources/Description
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 374 def populate_description_file( i = program_name? ) _ = ''.dup _ << '[Name] '+return_gobolinux_name_for_this_program(i)+N # Unsure whether this line is needed - htop 2.0.x does not have it. _ << '[Summary] '+short_desc?+N _ << '[Description] '+description?.rstrip+N # .split(N).join(NEW_LINE_SEPARATOR+N) _ << '[License] '+license?+N if has_a_homepage_url? _ << '[Homepage] '+homepage_url?+N else # else we will simply use url2 instead _ << '[Homepage] '+url2+N end into = @store_in_this_base_directory+program_name_and_version+'/Resources/Description' write_what_into(_, into) end
populate_recipe_file()
click to toggle source
#¶ ↑
#populate_recipe_file (recipe tag)¶ ↑
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 269 def populate_recipe_file add ''.dup add '# Recipe for version '+return_version+' (autogenerated via '\ 'file create_recipe.rb)'+N add '# Recipe (MakeRecipe) for '+return_gobolinux_name+N add 'compile_version='+USE_THIS_GOBOLINUX_COMPILE_VERSION+N add 'url='+pad_with_quotes(url1)+N add 'file_size='+return_file_size.to_s+N add 'file_md5='+return_md5sum.to_s+N add 'recipe_type=configure'+N add return_symlink_options # ======================================================================= # # Next, if the configure options for the given program in question exist, # then we will batch-add them to the recipe file. # ======================================================================= # coptions = configure_options? unless coptions.empty? # Only when it is NOT empty, will we append it. add 'configure_options=('+N coptions.squeeze(' ').split(' ').each {|inner_coption| unless inner_coption.include? '--enable-udev' # ================================================================= # # Use udev-options a bit differently - see GoboLinux recipes # such as libdrm. # ================================================================= # add ' '+inner_coption+N end } add ')'+N end consider_appending_more_stuff into = @store_in_this_base_directory+program_name_and_version+'/Recipe' # ======================================================================= # # The main String was built up there. # ======================================================================= # write_what_into(@main_string, into) end
program_name_and_version()
click to toggle source
reset()
click to toggle source
return_file_size()
click to toggle source
return_gobolinux_name(i = @this_program)
click to toggle source
#¶ ↑
#return_gobolinux_name¶ ↑
This method will return the GoboLinux name. It will make use of the class GobolinuxNamingConvention.
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 141 def return_gobolinux_name(i = @this_program) ::Cookbooks.return_gobolinux_name(i) end
Also aliased as: return_gobolinux_name_for_this_program
return_md5sum(i = path)
click to toggle source
#¶ ↑
#return_md5sum¶ ↑
Here we need to keep in mind that the target path may not exist.
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 173 def return_md5sum(i = path) if File.exist? i result = `md5sum #{i}`.split(' ').first result.chomp else opnn; e swarn('No target file at `')+sfile(i)+ swarn('`. We will continue nonetheless.') '0' # Return 0 in this case. end end
return_symlink_options()
click to toggle source
run()
click to toggle source
set_dataset(i = @this_program)
click to toggle source
set_store_in_this_base_directory(i = Dir.pwd)
click to toggle source
#¶ ↑
#set_store_in_this_base_directory¶ ↑
This method will keep track as to where to store the recipe - the base directory.
#¶ ↑
# File lib/cookbooks/gobolinux/create_recipe.rb, line 87 def set_store_in_this_base_directory(i = Dir.pwd) i = i.dup if i.frozen? i << '/' unless i.end_with? '/' @store_in_this_base_directory = i end
set_this_program(i)
click to toggle source
short_desc?()
click to toggle source
temporary_base_dir?()
click to toggle source
this_program?()
click to toggle source
url1()
click to toggle source
url2()
click to toggle source