- Start work on rpm support using my pure-ruby rpm library.
This commit is contained in:
parent
86a88dbaf5
commit
d05c332455
|
|
@ -38,7 +38,7 @@ class FPM::Package::Dir < FPM::Package
|
|||
# Copy all files from 'path' into staging_path
|
||||
|
||||
::Dir.chdir(@attributes[:chdir] || ".") do
|
||||
p :chdir => ::Dir.pwd, :source => source
|
||||
#p :chdir => ::Dir.pwd, :source => source
|
||||
Find.find(source).each do |file|
|
||||
next if source == file # ignore the directory itself
|
||||
# Translate file paths with attributes like 'prefix' and 'chdir'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
require "fpm/package"
|
||||
require "backports"
|
||||
require "fileutils"
|
||||
require "find"
|
||||
require "rpm" # gem 'rpm'
|
||||
require "rpm/file"
|
||||
|
||||
class FPM::Package::RPM < FPM::Package
|
||||
private
|
||||
|
||||
def <<(path)
|
||||
rpm = ::RPM::File.new(path)
|
||||
|
||||
tags = {}
|
||||
rpm.header.tags.each do |tag|
|
||||
tags[tag.tag] = tag.value
|
||||
end
|
||||
|
||||
# For all meaningful tags, set package metadata
|
||||
# TODO(sissel): find meaningful tags
|
||||
|
||||
# Extract to the staging directory
|
||||
rpm.extract(staging_path)
|
||||
end # def <<
|
||||
|
||||
def output(dir)
|
||||
end
|
||||
|
||||
public(:<<, :output)
|
||||
end # class FPM::Package::Dir
|
||||
Loading…
Reference in New Issue