diff options
Diffstat (limited to 'rbuild')
-rw-r--r-- | rbuild | 412 |
1 files changed, 307 insertions, 105 deletions
@@ -37,6 +37,12 @@ raise 'Please, use ruby1.9.3 or later.' if RUBY_VERSION < '1.9.3' #%% produce a makefile suitable for the target platform #require 'mkmf' #create_makefile("sisu") +#% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file) +SiSU_manual_setting_v_current = '4.2.x' +SiSU_manual_setting_v_next = '5.1.x' +#% rake file +SiSU_dir_v_current = 'v4' +SiSU_dir_v_next = 'v5' require 'find' require 'fileutils' #require 'ftools' @@ -148,6 +154,7 @@ def chmod_util(place) end #%% using a directory and its mapping def setup_find_create(dir_get,dir_put,exclude_files=['']) #primary, + begin Find.find("#{@p.dir.pwd}/#{dir_get}") do |f| stub=f.scan(/#{@p.dir.pwd}\/#{dir_get}\/(\S+)/).join place="#{dir_put}/#{stub}" @@ -165,6 +172,9 @@ def setup_find_create(dir_get,dir_put,exclude_files=['']) #p end puts "#{action}#{stub}" end + rescue + puts "\n\n<< are you root? required for install >>" + end end def setup_find_cp_r(dir_get,dir_put) #secondary, using recursive copy Find.find("#{@p.dir.pwd}/#{dir_get}") do |f| @@ -206,32 +216,31 @@ WOK end def sisu_version_info def version_file - def v4 - 'data/sisu/v4/v/version.yml' - #"#{Dir.pwd}/data/sisu/v4/v/version.yml" + def v_current_ + "data/sisu/#{SiSU_dir_v_current}/v/version.yml" end - def v5 - 'data/sisu/v5/v/version.yml' + def v_next_ + "data/sisu/#{SiSU_dir_v_next}/v/version.yml" end self end - def v4 - v="#{Dir.pwd}/#{version_file.v4}" + def yml_setting_v_current + v="#{Dir.pwd}/#{version_file.v_current_}" if File.exist?(v) YAML::load(File::open(v)) else '' end end - def v5 - v="#{Dir.pwd}/#{version_file.v5}" + def yml_setting_v_next + v="#{Dir.pwd}/#{version_file.v_next_}" if File.exist?(v) YAML::load(File::open(v)) else '' end end def current - puts v4 - puts v5 + puts yml_setting_v_current + puts yml_setting_v_next end def system_date `date "+%Y-%m-%d"`.strip @@ -240,18 +249,18 @@ def sisu_version_info `date "+%Yw%W/%u"`.strip end def set - def v4 + def manual_setting_v_current { project: 'SiSU', - version: '4.2.13', + version: "#{SiSU_manual_setting_v_current}", date: "#{system_date}", date_stamp: "#{system_date_stamp}", } end - def v5 + def manual_setting_v_next { project: 'SiSU', - version: '5.0.26', + version: "#{SiSU_manual_setting_v_next}", date: "#{system_date}", date_stamp: "#{system_date_stamp}", } @@ -276,49 +285,49 @@ proceed? } puts %{*WARN* is the file or directory writable? could not create #{filename}} end end - def commit_v4 + def commit_v_current versioninfo= <<-WOK --- -:version: #{sisu_version_info.v4[:version]} -:date_stamp: #{sisu_version_info.v4[:date_stamp]} -:date: "#{sisu_version_info.v4[:date]}" -:project: #{sisu_version_info.v4[:project]} +:version: #{sisu_version_info.yml_setting_v_current[:version]} +:date_stamp: #{sisu_version_info.yml_setting_v_current[:date_stamp]} +:date: "#{sisu_version_info.yml_setting_v_current[:date]}" +:project: #{sisu_version_info.yml_setting_v_current[:project]} WOK - puts version_file.v4 - version_info_commit(version_file.v4,versioninfo,set.v4,sisu_version_info.v4,version_file.v4) + puts version_file.v_current_ + version_info_commit(version_file.v_current_,versioninfo,set.manual_setting_v_current,sisu_version_info.yml_setting_v_current,version_file.v_current_) end - def commit_v5 + def commit_v_next versioninfo= <<-WOK --- -:version: #{sisu_version_info.v5[:version]} -:date_stamp: #{sisu_version_info.v5[:date_stamp]} -:date: "#{sisu_version_info.v5[:date]}" -:project: #{sisu_version_info.v5[:project]} +:version: #{sisu_version_info.yml_setting_v_next[:version]} +:date_stamp: #{sisu_version_info.yml_setting_v_next[:date_stamp]} +:date: "#{sisu_version_info.yml_setting_v_next[:date]}" +:project: #{sisu_version_info.yml_setting_v_next[:project]} WOK - puts version_file.v5 - version_info_commit(version_file.v5,versioninfo,set.v5,sisu_version_info.v5,version_file.v5) + puts version_file.v_next_ + version_info_commit(version_file.v_next_,versioninfo,set.manual_setting_v_next,sisu_version_info.yml_setting_v_next,version_file.v_next_) end def date_info end def changelog_header - def v4 + def v_current <<-WOK -%% #{sisu_version_info.v4[:version]}.orig.tar.xz (#{sisu_version_info.v4[:date]}:#{sisu_version_info.v4[:date_stamp]}) -http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_#{sisu_version_info.v4[:version]} -http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_#{sisu_version_info.v4[:version]}-1 -http://www.jus.uio.no/sisu/pkg/src/sisu_#{sisu_version_info.v4[:version]}.orig.tar.xz - sisu_#{sisu_version_info.v4[:version]}.orig.tar.xz - sisu_#{sisu_version_info.v4[:version]}-1.dsc +%% #{sisu_version_info.yml_setting_v_current[:version]}.orig.tar.xz (#{sisu_version_info.yml_setting_v_current[:date]}:#{sisu_version_info.yml_setting_v_current[:date_stamp]}) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_#{sisu_version_info.yml_setting_v_current[:version]} +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_#{sisu_version_info.yml_setting_v_current[:version]}-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_#{sisu_version_info.yml_setting_v_current[:version]}.orig.tar.xz + sisu_#{sisu_version_info.yml_setting_v_current[:version]}.orig.tar.xz + sisu_#{sisu_version_info.yml_setting_v_current[:version]}-1.dsc WOK end - def v5 + def v_next <<-WOK -%% #{sisu_version_info.v5[:version]}.orig.tar.xz (#{sisu_version_info.v5[:date]}:#{sisu_version_info.v5[:date_stamp]}) -http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_#{sisu_version_info.v5[:version]} -http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_#{sisu_version_info.v5[:version]}-1 -http://www.jus.uio.no/sisu/pkg/src/sisu_#{sisu_version_info.v5[:version]}.orig.tar.xz - sisu_#{sisu_version_info.v5[:version]}.orig.tar.xz - sisu_#{sisu_version_info.v5[:version]}-1.dsc +%% #{sisu_version_info.yml_setting_v_next[:version]}.orig.tar.xz (#{sisu_version_info.yml_setting_v_next[:date]}:#{sisu_version_info.yml_setting_v_next[:date_stamp]}) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_#{sisu_version_info.yml_setting_v_next[:version]} +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_#{sisu_version_info.yml_setting_v_next[:version]}-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_#{sisu_version_info.yml_setting_v_next[:version]}.orig.tar.xz + sisu_#{sisu_version_info.yml_setting_v_next[:version]}.orig.tar.xz + sisu_#{sisu_version_info.yml_setting_v_next[:version]}-1.dsc WOK end self @@ -332,20 +341,46 @@ def version_update_manual puts 'date_stamp: ' + `date "+%Yw%W/%u"` end def gemspecs - def sisu4 + def sisu_info_current + puts <<-WOK +-- +name: #{sisu_version_info.yml_setting_v_current[:project].downcase} +version: #{sisu_version_info.yml_setting_v_current[:version]} +date: #{sisu_version_info.yml_setting_v_current[:date]} +summary: #{sisu_version_info.yml_setting_v_current[:project]} + WOK + end + def sisu_yml_current + <<-WOK +Gem::Specification.new do |s| + s.name = '#{sisu_version_info.yml_setting_v_current[:project].downcase}' + s.version = '#{sisu_version_info.yml_setting_v_current[:version]}' + s.date = '#{sisu_version_info.yml_setting_v_current[:date]}' + s.summary = '#{sisu_version_info.yml_setting_v_current[:project]}' + s.description = 'SiSU gem' + s.authors = ["Ralph Amissah"] + s.email = 'ralph.amissah@gmail.com' + s.files = Dir['lib/sisu/#{SiSU_dir_v_current}/*.rb'] + + Dir['data/sisu/#{SiSU_dir_v_current}/v/version.yml'] + + Dir['bin/sisugem'] + + Dir['bin/sisu'] + s.license = 'GPL3' + s.executables << 'sisugem' << 'sisu' +end + WOK + end + def sisu_manual_setting_current <<-WOK Gem::Specification.new do |s| - s.name = '#{sisu_version_info.v4[:project].downcase}' - s.version = '#{sisu_version_info.v4[:version]}' - s.date = '#{sisu_version_info.v4[:date]}' - s.summary = '#{sisu_version_info.v4[:project]}' + s.name = '#{sisu_version_info.set.manual_setting_v_current[:project].downcase}' + s.version = '#{sisu_version_info.set.manual_setting_v_current[:version]}' + s.date = '#{sisu_version_info.set.manual_setting_v_current[:date]}' + s.summary = '#{sisu_version_info.set.manual_setting_v_current[:project]}' s.description = 'SiSU gem' s.authors = ["Ralph Amissah"] s.email = 'ralph.amissah@gmail.com' - s.files = Dir['lib/sisu/v4/*.rb'] + - Dir['lib/sisu/v5/*.rb'] + - Dir['data/sisu/v4/v/version.yml'] + - Dir['data/sisu/v5/v/version.yml'] + + s.files = Dir['lib/sisu/#{SiSU_dir_v_current}/*.rb'] + + Dir['data/sisu/#{SiSU_dir_v_current}/v/version.yml'] + Dir['bin/sisugem'] + Dir['bin/sisu'] s.license = 'GPL3' @@ -353,20 +388,46 @@ Gem::Specification.new do |s| end WOK end - def sisu5 + def sisu_info_next + puts <<-WOK +-- +name: #{sisu_version_info.yml_setting_v_next[:project].downcase} +version: #{sisu_version_info.yml_setting_v_next[:version]} +date: #{sisu_version_info.yml_setting_v_next[:date]} +summary: #{sisu_version_info.yml_setting_v_next[:project]} + WOK + end + def sisu_yml_next <<-WOK Gem::Specification.new do |s| - s.name = '#{sisu_version_info.v5[:project].downcase}' - s.version = '#{sisu_version_info.v5[:version]}' - s.date = '#{sisu_version_info.v5[:date]}' - s.summary = '#{sisu_version_info.v5[:project]}' + s.name = '#{sisu_version_info.yml_setting_v_next[:project].downcase}' + s.version = '#{sisu_version_info.yml_setting_v_next[:version]}' + s.date = '#{sisu_version_info.yml_setting_v_next[:date]}' + s.summary = '#{sisu_version_info.yml_setting_v_next[:project]}' s.description = 'SiSU gem' s.authors = ["Ralph Amissah"] s.email = 'ralph.amissah@gmail.com' - s.files = Dir['lib/sisu/v4/*.rb'] + - Dir['lib/sisu/v5/*.rb'] + - Dir['data/sisu/v4/v/version.yml'] + - Dir['data/sisu/v5/v/version.yml'] + + s.files = Dir['lib/sisu/#{SiSU_dir_v_next}/*.rb'] + + Dir['data/sisu/#{SiSU_dir_v_next}/v/version.yml'] + + Dir['bin/sisugem'] + + Dir['bin/sisu'] + s.license = 'GPL3' + s.executables << 'sisugem' << 'sisu' +end + WOK + end + def sisu_manual_setting_next + <<-WOK +Gem::Specification.new do |s| + s.name = '#{sisu_version_info.set.manual_setting_v_next[:project].downcase}' + s.version = '#{sisu_version_info.set.manual_setting_v_next[:version]}' + s.date = '#{sisu_version_info.set.manual_setting_v_next[:date]}' + s.summary = '#{sisu_version_info.set.manual_setting_v_next[:project]}' + s.description = 'SiSU gem' + s.authors = ["Ralph Amissah"] + s.email = 'ralph.amissah@gmail.com' + s.files = Dir['lib/sisu/#{SiSU_dir_v_next}/*.rb'] + + Dir['data/sisu/#{SiSU_dir_v_next}/v/version.yml'] + Dir['bin/sisugem'] + Dir['bin/sisu'] s.license = 'GPL3' @@ -384,28 +445,66 @@ end puts %{*WARN* is the file or directory writable? could not create #{filename}} end end - def sisu4_gemspec_create - filename='sisu4.gemspec' - gemspec_create(filename,sisu4) + def sisu_filename_yml_current + "sisu-#{sisu_version_info.yml_setting_v_current[:version]}" + end + def sisu_filename_yml_next + "sisu-#{sisu_version_info.yml_setting_v_next[:version]}" end - def sisu5_gemspec_create - filename='sisu5.gemspec' - gemspec_create(filename,sisu5) + def sisu_filename_manual_current + "sisu-#{sisu_version_info.set.manual_setting_v_current[:version]}" end - def sisu4_build - system(%{ gem build sisu4.gemspec }) + def sisu_filename_manual_next + "sisu-#{sisu_version_info.set.manual_setting_v_next[:version]}" end - def sisu5_build - system(%{ gem build sisu5.gemspec }) + def sisu_gemspec_create_current + filename="#{sisu_filename_yml_current}.gemspec" + gemspec_create(filename,sisu_yml_current) + gemspec_create('sisu-current.gemspec',sisu_yml_current) end - def sisu4_install + def sisu_gemspec_create_next + filename="#{sisu_filename_yml_next}.gemspec" + gemspec_create(filename,sisu_yml_next) + gemspec_create('sisu-next.gemspec',sisu_yml_next) + end + def sisu_gemspec_create_manual_version_current + filename="#{sisu_filename_manual_current}.gemspec" + gemspec_create(filename,sisu_manual_setting_current) + end + def sisu_gemspec_create_manual_version_next + filename="#{sisu_filename_manual_next}.gemspec" + gemspec_create(filename,sisu_manual_setting_next) + end + def sisu_build_current + system(%{ gem build #{sisu_filename_yml_current}.gemspec }) + end + def sisu_build_next + system(%{ gem build #{sisu_filename_yml_next}.gemspec }) + end + def sisu_build_manual_current + system(%{ gem build #{sisu_filename_manual_current}.gemspec}) + end + def sisu_build_manual_next + system(%{ gem build #{sisu_filename_manual_next}.gemspec}) + end + def sisu_install_current system(%{ - sudo gem install --no-rdoc --no-ri --verbose sisu-#{sisu_version_info.v4[:version]}.gem + sudo gem install --no-rdoc --no-ri --verbose sisu-#{sisu_version_info.yml_setting_v_current[:version]}.gem }) end - def sisu5_install + def sisu_install_next system(%{ - sudo gem install --no-rdoc --no-ri --verbose sisu-#{sisu_version_info.v5[:version]}.gem + sudo gem install --no-rdoc --no-ri --verbose sisu-#{sisu_version_info.yml_setting_v_next[:version]}.gem + }) + end + def sisu_install_manual_current + system(%{ + sudo gem install --no-rdoc --no-ri --verbose #{sisu_filename_manual_current}.gem + }) + end + def sisu_install_manual_next + system(%{ + sudo gem install --no-rdoc --no-ri --verbose #{sisu_filename_manual_next}.gem }) end self @@ -460,18 +559,73 @@ desc "check package version" task :sisuversion => [:sisu_version] desc "set package version" task :sisuversionset => [:sisu_version_set] -desc "check gempsec info" +desc "check gemspec info" task :gemspec => [:gemspec_info] -desc "create gempsec" -task :gemspecscreate => [:gemspecs_create] +desc "create sisu v_current gemspec" +task :gem4cs => [:gemspecs_current_create_default_version] +task :gem4createspecs => [:gemspecs_current_create_default_version] +desc "create sisu v_next gemspec" +task :gem5cs => [:gemspecs_next_create_default_version] +task :gem5createspecs => [:gemspecs_next_create_default_version] +desc "create gemspec" +task :gemcs => [:gemspecs_create_default_version] +task :gemc => [:gemspecs_create_default_version] +task :gemspecscreate => [:gemspecs_create_default_version] +#--- desc "build gem" +task :gemb => [:gem_build] task :gembuild => [:gem_build] +desc "build sisu v_current gem" +task :gem4b => [:gem_current_build] +task :gem4build => [:gem_current_build] +desc "build sisu v_next gem" +task :gem5b => [:gem_next_build] +task :gem5build => [:gem_next_build] desc "install gem" +task :gemi => [:gem_install] task :geminstall => [:gem_install] -desc "build and install gem" -task :gembuildinstall => [:gem_build,:gem_install] -desc "create, build and install sisu gem" -task :gemcbi => [:gemspecs_create,:gem_build,:gem_install] +desc "build & install sisu v_current gem" +task :gem4bi => [:gem_current_build,:gem_install] +desc "build & install sisu v_next gem" +task :gem5bi => [:gem_next_build,:gem_install] +desc "build & install gem" +task :gembi => [:gem_build,:gem_install] +desc "create, build & install sisu v_current gem" +task :gem4cbi => [:gemspecs_current_create_default_version,:gem_current_build,:gem_current_install] +desc "create, build & install sisu v_next gem" +task :gem5cbi => [:gemspecs_next_create_default_version,:gem_next_build,:gem_next_install] +desc "create, build & install sisu v_current & v_next gem" +task :gemcbi => [:gemspecs_create_default_version,:gem_build,:gem_install] +#--- +desc "create sisu v_current gemspec, manually set version" +task :gem4csm => [:gemspecs_current_create_manual_version] +desc "create sisu v_next gemspec, manually set version" +task :gem5csm => [:gemspecs_next_create_manual_version] +desc "create gemspec, manually set version" +task :gemcsm => [:gemspecs_create_manual_version] +task :gemcm => [:gemspecs_create_manual_version] +#--- +desc "build gem" +task :gembm => [:gem_build_manual_version] +desc "build sisu v_current gem" +task :gem4bm => [:gem_current_build_manual_version] +desc "build sisu v_next gem" +task :gem5bm => [:gem_next_build_manual_version] +desc "install gem" +task :gemim => [:gem_install_manual_version] +desc "build & install sisu v_current gem" +task :gem4bim => [:gem_current_build_manual_version,:gem_install_manual_version] +desc "build & install sisu v_next gem" +task :gem5bim => [:gem_next_build_manual_version,:gem_install_manual_version] +desc "build & install gem" +task :gembim => [:gem_build_manual_version,:gem_install_manual_version] +desc "create, build & install sisu v_current gem" +task :gem4cbim => [:gemspecs_current_create_manual_version,:gem_current_build_manual_version,:gem_current_install_manual_version] +desc "create, build & install sisu v_next gem" +task :gem5cbim => [:gemspecs_next_create_manual_version,:gem_next_build_manual_version,:gem_next_install_manual_version] +desc "create, build & install sisu v_current & v_next gem" +task :gemcbim => [:gemspecs_create_manual_version,:gem_build_manual_version,:gem_install_manual_version] +#--- desc "check changelog headers" task :changelogheaders => [:changelog_headers] if File.directory?('bin') #bin @@ -625,47 +779,95 @@ task :setup_vim do #man end task :gemspec_info do #man version_update_manual - gemspecs.sisu4 - gemspecs.sisu5 + gemspecs.sisu_info_current + gemspecs.sisu_info_next end -task :gemspecs_create do #man - gemspecs.sisu4_gemspec_create - gemspecs.sisu5_gemspec_create +task :gemspecs_current_create_default_version do #man + gemspecs.sisu_gemspec_create_current +end +task :gemspecs_next_create_default_version do #man + gemspecs.sisu_gemspec_create_next +end +task :gemspecs_create_default_version do #man + gemspecs.sisu_gemspec_create_current + gemspecs.sisu_gemspec_create_next +end +task :gemspecs_current_create_manual_version do #man + gemspecs.sisu_gemspec_create_manual_version_current +end +task :gemspecs_next_create_manual_version do #man + gemspecs.sisu_gemspec_create_manual_version_next +end +task :gemspecs_create_manual_version do #man + gemspecs.sisu_gemspec_create_manual_version_current + gemspecs.sisu_gemspec_create_manual_version_next +end +task :gem_current_build do #man + gemspecs.sisu_build_current +end +task :gem_next_build do #man + gemspecs.sisu_build_next end task :gem_build do #man - gemspecs.sisu4_build - gemspecs.sisu5_build + gemspecs.sisu_build_current + gemspecs.sisu_build_next +end +task :gem_current_build_manual_version do #man + gemspecs.sisu_build_manual_current +end +task :gem_next_build_manual_version do #man + gemspecs.sisu_build_manual_next +end +task :gem_build_manual_version do #man + gemspecs.sisu_build_manual_current + gemspecs.sisu_build_manual_next +end +task :gem_current_install do #man + gemspecs.sisu_install_current +end +task :gem_next_install do #man + gemspecs.sisu_install_next end task :gem_install do #man - gemspecs.sisu4_install - gemspecs.sisu5_install + gemspecs.sisu_install_current + gemspecs.sisu_install_next +end +task :gem_current_install_manual_version do #man + gemspecs.sisu_install_manual_current +end +task :gem_next_install_manual_version do #man + gemspecs.sisu_install_manual_next +end +task :gem_install_manual_version do #man + gemspecs.sisu_install_manual_current + gemspecs.sisu_install_next end task :changelog_headers do #man puts '---' - puts sisu_version_info.set.changelog_header.v4 + puts sisu_version_info.set.changelog_header.v_current puts '---' - puts sisu_version_info.set.changelog_header.v5 + puts sisu_version_info.set.changelog_header.v_next end task :sisu_version do #man - puts sisu_version_info.set.v4 - puts sisu_version_info.set.v5 + puts sisu_version_info.set.manual_setting_v_current + puts sisu_version_info.set.manual_setting_v_next puts sisu_version_info.current #version.current.each do |x| # puts x #end - puts sisu_version_info.v4[:project] - puts sisu_version_info.v4[:version] - puts sisu_version_info.v4[:date] - puts sisu_version_info.v4[:date_stamp] + puts sisu_version_info.yml_setting_v_current[:project] + puts sisu_version_info.yml_setting_v_current[:version] + puts sisu_version_info.yml_setting_v_current[:date] + puts sisu_version_info.yml_setting_v_current[:date_stamp] puts '---' - puts sisu_version_info.v5[:project] - puts sisu_version_info.v5[:version] - puts sisu_version_info.v5[:date] - puts sisu_version_info.v5[:date_stamp] + puts sisu_version_info.yml_setting_v_next[:project] + puts sisu_version_info.yml_setting_v_next[:version] + puts sisu_version_info.yml_setting_v_next[:date] + puts sisu_version_info.yml_setting_v_next[:date_stamp] end task :sisu_version_set do #man - sisu_version_info.set.commit_v4 - sisu_version_info.set.commit_v5 + sisu_version_info.set.commit_v_current + sisu_version_info.set.commit_v_next end #%% post install #%% clobber/remove tasks |