Sha256: e4e7a1764ae6af71394f8f7672fb16b5d3f4ccdd16840934f4f9188b8f7773a9

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

def build_rpm(buildarg = "-bs")
  check_tool('rpmbuild')
  temp = get_temp
  rpm_define = "--define \"%dist .el5\" --define \"%_topdir  #{temp}\" "
  rpm_old_version = '--define "_source_filedigest_algorithm 1" --define "_binary_filedigest_algorithm 1" \
     --define "_binary_payload w9.gzdio" --define "_source_payload w9.gzdio" \
     --define "_default_patch_fuzz 2"'
  args = rpm_define + ' ' + rpm_old_version
  mkdir_pr temp, 'pkg/rpm', 'pkg/srpm', "#{temp}/SOURCES", "#{temp}/SPECS"
  if @sign_tar
    Rake::Task["pl:sign_tar"].invoke
    cp_p "pkg/#{@name}-#{@version}.tar.gz.asc", "#{temp}/SOURCES"
  end
  cp_p "pkg/#{@name}-#{@version}.tar.gz", "#{temp}/SOURCES"
  erb "ext/redhat/#{@name}.spec.erb", "#{temp}/SPECS/#{@name}.spec"
  sh "rpmbuild #{args} #{buildarg} --nodeps #{temp}/SPECS/#{@name}.spec"
  mv FileList["#{temp}/SRPMS/*.rpm"], "pkg/srpm"
  mv FileList["#{temp}/RPMS/*/*.rpm"], "pkg/rpm"
  rm_rf temp
  puts
  output = FileList['pkg/*/*.rpm']
  puts "Wrote:"
  output.each do | line |
    puts line
  end
end

namespace :package do
  desc "Create srpm from this git repository (unsigned)"
  task :srpm => :tar do
    build_rpm("-bs")
  end

  desc "Create .rpm from this git repository (unsigned)"
  task :rpm => :tar do
    build_rpm("-ba")
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
puppet-3.0.0 ext/packaging/tasks/rpm.rake
facter-1.6.13.rc1 ext/packaging/tasks/rpm.rake
puppet-3.0.0.rc8 ext/packaging/tasks/rpm.rake
puppet-3.0.0.rc7 ext/packaging/tasks/rpm.rake
facter-1.6.12 ext/packaging/tasks/rpm.rake
facter-1.6.12.rc2 ext/packaging/tasks/rpm.rake
facter-1.6.12.rc1 ext/packaging/tasks/rpm.rake