diff options
Diffstat (limited to 'setup/rbuild_libs.rb')
-rw-r--r-- | setup/rbuild_libs.rb | 145 |
1 files changed, 40 insertions, 105 deletions
diff --git a/setup/rbuild_libs.rb b/setup/rbuild_libs.rb index 5345631b..f685074e 100644 --- a/setup/rbuild_libs.rb +++ b/setup/rbuild_libs.rb @@ -60,7 +60,7 @@ module Project_details end def self.version stamp={} - v="#{dir.pwd}/conf/sisu/version.yml" + v="#{dir.pwd}/data/sisu/version.yml" if File.exist?(v) stamp=YAML::load(File::open(v)) stamp[:version] @@ -190,9 +190,37 @@ module Version_info :date: "#{vi[:date]}" WOK end + def self.git_version_extract + if FileTest.file?('/usr/bin/git') + x=`git describe --long --tags 2>&1`.strip. + gsub(/^[a-z_-]*([0-9.]+)/,'\1'). + gsub(/([^-]*-g)/,'r\1'). + gsub(/-/,'.') + x=(x=~/^[0-9]+\.[0-9]+\.[0-9]+\.r[0-9]+\.g[0-9a-f]{7}/) \ + ? x + : nil + else nil + end + end + def self.version_number_use(vi) + (git_version_extract.nil?) \ + ? (vi[:version]) + : git_version_extract + end + def self.version_number_info(vi) + (Version_info.version_number_use(vi) != vi[:version_number]) \ + ? (%{#{vi[:version_number]} from git #{Version_info.version_number_use(vi)}}) + : vi[:version_number] + end + def self.version_number_info_stable + vi=Version_info::Current.setting_stable + (Version_info.version_number_use(vi) != vi[:version_number]) \ + ? (%{#{vi[:version_number]} from git #{Version_info.version_number_use(vi)}}) + : vi[:version_number] + end module Current - def self.yml_file_path(version) - "data/sisu/version/#{version}.yml" + def self.yml_file_path + 'data/sisu/version.yml' end def self.settings(file) v="#{Dir.pwd}/#{file}" @@ -202,10 +230,7 @@ module Version_info end end def self.file_stable - yml_file_path(SiSU_version_dir_stable) - end - def self.file_unstable - yml_file_path(SiSU_version_dir_unstable) + yml_file_path end def self.setting_stable hsh=settings(file_stable) @@ -213,18 +238,9 @@ module Version_info match(hsh[:version])[1] hsh end - def self.setting_unstable - hsh=settings(file_unstable) - hsh[:version_number]=/([0-9]+\.[0-9]+\.[0-9]+)/. - match(hsh[:version])[1] - hsh - end def self.content_stable Version_info.contents(setting_stable) end - def self.content_unstable - Version_info.contents(setting_unstable) - end end module Next def self.settings(v) @@ -238,15 +254,9 @@ module Version_info def self.setting_stable settings(SiSU_version_next_stable) end - def self.setting_unstable - settings(SiSU_version_next_unstable) - end def self.content_stable Version_info.contents(setting_stable) end - def self.content_unstable - Version_info.contents(setting_unstable) - end end module Update def self.version_info_update_commit(filename,vi_hash_current,vi_content_current,vi_hash_next,vi_content_next) @@ -279,15 +289,6 @@ proceed? } Version_info::Next.content_stable ) end - def self.update_unstable - version_info_update_commit( - Version_info::Current.file_unstable, - Version_info::Current.setting_unstable, - Version_info::Current.content_unstable, - Version_info::Next.setting_unstable, - Version_info::Next.content_unstable - ) - end def self.changelog_header(vi) <<-WOK ** #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) @@ -301,9 +302,6 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz def self.changelog_header_stable changelog_header(Version_info::Current.setting_stable) end - def self.changelog_header_unstable - changelog_header(Version_info::Current.setting_unstable) - end end self end @@ -326,15 +324,7 @@ module GitExtractTaggedVersionBuild elsif vb.tag =~/^[0-9]\.[0-9]+\.[0-9]+/ then 'sisu_' + vb.tag else vb.branch end - install_branch=case vb.branch - when /^(?:stable|unstable)$/ - "gem_create_build_#{vb.branch}" - when /^(?:all)/ - 'gem_create_build' - else - 'gem_create_build_stable' - #'gem_create_build_install_stable' - end + install_branch='gem_create_build_stable' commands =<<-WOK git checkout #{ver} && rake #{install_branch}; @@ -353,14 +343,7 @@ module GitExtractTaggedVersionBuild elsif vb.tag =~/^[0-9]\.[0-9]+\.[0-9]+/ then 'sisu_' + vb.tag else vb.branch end - install_branch=case vb.branch - when /^(?:stable|unstable)$/ - "gem_create_build_install_#{vb.branch}" - when /^(?:all)/ - 'gem_create_build_install' - else - 'gem_create_build_install_stable' - end + install_branch='gem_create_build_install_stable' commands =<<-WOK git checkout #{ver} && rake #{install_branch}; @@ -384,18 +367,19 @@ date: #{vi[:date]} summary: #{vi[:project]} WOK end - def self.contents(vi,version) + def self.contents(vi) + #s.summary = '#{vi[:project]}' <<-WOK Gem::Specification.new do |s| s.name = '#{vi[:project].downcase}' s.version = '#{vi[:version_number]}' s.date = '#{vi[:date]}' - s.summary = '#{vi[:project]}' - s.description = '#{Project_details.name} gem' + s.summary = '#{Version_info.version_number_info(vi)}' + s.description = 'documents - structuring, publishing in multiple formats and search' s.authors = ["Ralph Amissah"] s.email = 'ralph.amissah@gmail.com' - s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] + - Dir['data/#{Project_details.name.downcase}/#{version}/version.yml'] + + s.files = Dir['lib/#{Project_details.name.downcase}/*.rb'] + + Dir['data/#{Project_details.name.downcase}/version.yml'] + Dir['data/#{Project_details.name.downcase}/image/*'] + Dir['bin/#{Project_details.name.downcase}gem'] + Dir['bin/#{Project_details.name.downcase}'] @@ -428,27 +412,12 @@ end + '-' \ + Version_info::Current.setting_stable[:version_number] end - def self.filename_unstable - Project_details.name.downcase \ - + '-' \ - + Version_info::Current.setting_unstable[:version_number] - end def self.info_stable Gemspecs.info(Version_info::Current.setting_stable) end - def self.info_unstable - Gemspecs.info(Version_info::Current.setting_unstable) - end def self.current_stable Gemspecs.contents( Version_info::Current.setting_stable, - SiSU_version_dir_stable - ) - end - def self.current_unstable - Gemspecs.contents( - Version_info::Current.setting_unstable, - SiSU_version_dir_unstable ) end def self.create_stable @@ -458,25 +427,12 @@ end current_stable ) end - def self.create_unstable - Gemspecs.create(filename_unstable,current_unstable) - Gemspecs.create( - "#{Project_details.name.downcase}-unstable", - current_unstable - ) - end def self.build_stable Gemspecs.build(filename_stable) end - def self.build_unstable - Gemspecs.build(filename_unstable) - end def self.install_stable Gemspecs.install(filename_stable) end - def self.install_unstable - Gemspecs.install(filename_unstable) - end end module Next def self.filename_stable @@ -484,40 +440,19 @@ end + '-' \ + Version_info::Next.setting_stable[:version_number] end - def self.filename_unstable - Project_details.name.downcase \ - + '-' \ - + Version_info::Next.setting_unstable[:version_number] - end def self.setting_stable Gemspecs.contents( Version_info::Next.setting_stable, - SiSU_version_dir_stable - ) - end - def self.setting_unstable - Gemspecs.contents( - Version_info::Next.setting_unstable, - SiSU_version_dir_unstable ) end def self.create_stable Gemspecs.create(filename_stable,setting_stable) end - def self.create_unstable - Gemspecs.create(filename_unstable,setting_unstable) - end def self.build_stable Gemspecs.build(filename_stable) end - def self.build_unstable - Gemspecs.build(filename_unstable) - end def self.install_stable Gemspecs.install(filename_stable) end - def self.install_unstable - Gemspecs.install(filename_unstable) - end end end |