aboutsummaryrefslogtreecommitdiffhomepage
path: root/rbuild
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-12-03 00:37:26 -0500
committerRalph Amissah <ralph@amissah.com>2013-12-03 00:37:26 -0500
commita7c0e410ff7c54b5f36ec0f64fc69533b5adc712 (patch)
tree9e6b12bbd11938c4bc65b41e105ad0a4dcccf99a /rbuild
parentdebian/changelog (4.2.12-1) (diff)
parentv5: documentation related to commands for new outputs in development (diff)
Merge tag 'sisu_4.2.13' into debian/sid
SiSU 4.2.13
Diffstat (limited to 'rbuild')
-rw-r--r--rbuild293
1 files changed, 279 insertions, 14 deletions
diff --git a/rbuild b/rbuild
index 084d3ad7..f2cc6638 100644
--- a/rbuild
+++ b/rbuild
@@ -147,15 +147,17 @@ def chmod_util(place)
end
end
#%% using a directory and its mapping
-def setup_find_create(dir_get,dir_put) #primary,
+def setup_find_create(dir_get,dir_put,exclude_files=['']) #primary,
Find.find("#{@p.dir.pwd}/#{dir_get}") do |f|
stub=f.scan(/#{@p.dir.pwd}\/#{dir_get}\/(\S+)/).join
place="#{dir_put}/#{stub}"
action=case
when File.file?(f)
- cp(f,place)
- chmod_file(place)
- "-> #{dir_put}/"
+ unless f =~/#{exclude_files.inspect}/
+ cp(f,place)
+ chmod_file(place)
+ "-> #{dir_put}/"
+ end
when File.directory?(f)
FileUtils.mkpath(place) unless FileTest.directory?(place)
"./#{dir_get}/"
@@ -202,6 +204,212 @@ def system_info
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"
+ end
+ def v5
+ 'data/sisu/v5/v/version.yml'
+ end
+ self
+ end
+ def v4
+ v="#{Dir.pwd}/#{version_file.v4}"
+ if File.exist?(v)
+ YAML::load(File::open(v))
+ else ''
+ end
+ end
+ def v5
+ v="#{Dir.pwd}/#{version_file.v5}"
+ if File.exist?(v)
+ YAML::load(File::open(v))
+ else ''
+ end
+ end
+ def current
+ puts v4
+ puts v5
+ end
+ def system_date
+ `date "+%Y-%m-%d"`.strip
+ end
+ def system_date_stamp
+ `date "+%Yw%W/%u"`.strip
+ end
+ def set
+ def v4
+ {
+ project: 'SiSU',
+ version: '4.2.13',
+ date: "#{system_date}",
+ date_stamp: "#{system_date_stamp}",
+ }
+ end
+ def v5
+ {
+ project: 'SiSU',
+ version: '5.0.26',
+ date: "#{system_date}",
+ date_stamp: "#{system_date_stamp}",
+ }
+ end
+ def version_info_commit(filename,versioninfo,newversioninfo,existingversioninfo,version_file_is)
+ ans=%{update sisu version info replacing:
+ #{existingversioninfo.sort}
+with:
+ #{newversioninfo.sort}
+
+#{version_file_is} becoming:
+#{versioninfo}
+proceed? }
+ resp=answer?(ans)
+ exit unless resp
+ fn="#{Dir.pwd}/#{filename}"
+ if File.writable?("#{Dir.pwd}/.")
+ file_version=File.new(fn,'w+')
+ file_version << versioninfo
+ file_version.close
+ else
+ puts %{*WARN* is the file or directory writable? could not create #{filename}}
+ end
+ end
+ def commit_v4
+ 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]}
+ WOK
+ puts version_file.v4
+ version_info_commit(version_file.v4,versioninfo,set.v4,sisu_version_info.v4,version_file.v4)
+ end
+ def commit_v5
+ 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]}
+ WOK
+ puts version_file.v5
+ version_info_commit(version_file.v5,versioninfo,set.v5,sisu_version_info.v5,version_file.v5)
+ end
+ def date_info
+ end
+ def changelog_header
+ def v4
+ <<-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
+ WOK
+ end
+ def v5
+ <<-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
+ WOK
+ end
+ self
+ end
+ self
+ end
+ self
+end
+def version_update_manual
+ puts 'date: ' + `date "+%Y-%m-%d"`
+ puts 'date_stamp: ' + `date "+%Yw%W/%u"`
+end
+def gemspecs
+ def sisu4
+ <<-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.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'] +
+ Dir['bin/sisugem'] +
+ Dir['bin/sisu']
+ s.license = 'GPL3'
+ s.executables << 'sisugem' << 'sisu'
+end
+ WOK
+ end
+ def sisu5
+ <<-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.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'] +
+ Dir['bin/sisugem'] +
+ Dir['bin/sisu']
+ s.license = 'GPL3'
+ s.executables << 'sisugem' << 'sisu'
+end
+ WOK
+ end
+ def gemspec_create(filename,gemspec)
+ fn="#{Dir.pwd}/#{filename}"
+ if File.writable?("#{Dir.pwd}/.")
+ file_sisu_gemspec=File.new(fn,'w+')
+ file_sisu_gemspec << gemspec
+ file_sisu_gemspec.close
+ else
+ 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)
+ end
+ def sisu5_gemspec_create
+ filename='sisu5.gemspec'
+ gemspec_create(filename,sisu5)
+ end
+ def sisu4_build
+ system(%{ gem build sisu4.gemspec })
+ end
+ def sisu5_build
+ system(%{ gem build sisu5.gemspec })
+ end
+ def sisu4_install
+ system(%{
+ sudo gem install --no-rdoc --no-ri --verbose sisu-#{sisu_version_info.v4[:version]}.gem
+ })
+ end
+ def sisu5_install
+ system(%{
+ sudo gem install --no-rdoc --no-ri --verbose sisu-#{sisu_version_info.v5[:version]}.gem
+ })
+ end
+ self
+end
def project_help
puts <<WOK
@@ -234,10 +442,10 @@ For a more detailed and up to date list of command options use:
WOK
end
def tasks
- sys('rant -T')
+ system('rake -T')
end
- #% tasks
-desc "rake/rant (as root type 'rake' or 'rant' for default action)"
+#% tasks
+desc "rake/rant sisu install (as root type 'rake' or 'rant')"
task :default => [:default_notice,:setup_base]
#task :default => [:help,:notice,:project]
desc "Setup/Install #{@p.name} and try generate a file"
@@ -248,6 +456,24 @@ desc "Setup/Install #{@p.name}: bin, lib and conf (no data)"
task :setup_base=> [:setup_bin,:setup_lib,:setup_conf,:setup_share,:setup_man,:setup_vim]
desc "Setup/Install #{@p.name} bin, lib and conf (no data and no attempt to do postinstall setup)"
task :base=> [:setup_base]
+desc "check package version"
+task :sisuversion => [:sisu_version]
+desc "set package version"
+task :sisuversionset => [:sisu_version_set]
+desc "check gempsec info"
+task :gemspec => [:gemspec_info]
+desc "create gempsec"
+task :gemspecscreate => [:gemspecs_create]
+desc "build gem"
+task :gembuild => [:gem_build]
+desc "install gem"
+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 "check changelog headers"
+task :changelogheaders => [:changelog_headers]
if File.directory?('bin') #bin
desc "Setup #{@p.name} bin only, synonym :bin"
task :bin => [:setup_bin]
@@ -297,10 +523,6 @@ if File.directory?('conf') #conf
desc "Remove #{@p.name} conf only" #remove conf
task :remove_conf => [:remove_conf]
end
-#if File.directory?('data') #data
-# desc "Remove #{@p.name} data only" #remove data
-# task :remove_data => [:remove_data]
-#end
desc "Re-setup #{@p.name}, synonym :reinstall" #resetup reinstall
task :resetup => [:remove, :setup]
task :reinstall => [:remove, :setup]
@@ -345,8 +567,6 @@ task :help => [:project_help,:system_info,:tasks]
#desc "Setup/Install #{@p.name} (uses filelist)"
task :install => [:default_notice,:project]
task :install_bin => [:setup_bin]
-desc '[make rant independent install file]'
-task :create_rant_independent_task_file => [:rant_independence]
#%% setup/install tasks
task :rant_independence do #notice
resp=''
@@ -381,7 +601,8 @@ task :default2 do #secondary
setup_find_cp_r('man',@p.dir.man) if File.directory?('man')
end
task :setup_bin do #bin
- setup_find_create('bin',@p.dir.bin) if File.directory?('bin')
+ exclude_files=['sisugem']
+ setup_find_create('bin',@p.dir.bin,exclude_files) if File.directory?('bin')
end
task :setup_lib do #lib
setup_find_create('lib',@p.dir.lib) if File.directory?('lib')
@@ -402,6 +623,50 @@ end
task :setup_vim do #man
setup_find_create('data/vim',@p.dir.vim) if File.directory?('data/vim') #man pages
end
+task :gemspec_info do #man
+ version_update_manual
+ gemspecs.sisu4
+ gemspecs.sisu5
+end
+task :gemspecs_create do #man
+ gemspecs.sisu4_gemspec_create
+ gemspecs.sisu5_gemspec_create
+end
+task :gem_build do #man
+ gemspecs.sisu4_build
+ gemspecs.sisu5_build
+end
+task :gem_install do #man
+ gemspecs.sisu4_install
+ gemspecs.sisu5_install
+end
+task :changelog_headers do #man
+ puts '---'
+ puts sisu_version_info.set.changelog_header.v4
+ puts '---'
+ puts sisu_version_info.set.changelog_header.v5
+end
+task :sisu_version do #man
+ puts sisu_version_info.set.v4
+ puts sisu_version_info.set.v5
+ 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 '---'
+ 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]
+end
+task :sisu_version_set do #man
+ sisu_version_info.set.commit_v4
+ sisu_version_info.set.commit_v5
+end
#%% post install
#%% clobber/remove tasks
task :remove_bin do