Class: FPM::Source::RPM
- Inherits:
-
FPM::Source
- Object
- FPM::Source
- FPM::Source::RPM
- Defined in:
- lib/fpm/source/rpm.rb
Instance Attribute Summary
Attributes inherited from FPM::Source
Instance Method Summary collapse
Methods inherited from FPM::Source
#[], #[]=, #dependencies, #get_source, #initialize, #metadata, #package
Constructor Details
This class inherits a constructor from FPM::Source
Instance Method Details
#get_metadata ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fpm/source/rpm.rb', line 5 def @rpm = @paths.first self[:name] = %x{rpm -q --qf '%{name}' -p #{@rpm}}.chomp self[:version] = %x{rpm -q --qf '%{version}' -p #{@rpm}}.chomp self[:iteration] = %x{rpm -q --qf '%{release}' -p #{@rpm}}.chomp self[:summary] = %x{rpm -q --qf '%{summary}' -p #{@rpm}}.chomp #self[:description] = %x{rpm -q --qf '%{description}' -p #{@rpm}} self[:dependencies] = %x{rpm -qRp #{@rpm}}.split("\n")\ .collect { |line| line.strip } @paths = %x{rpm -qlp #{@rpm}}.split("\n") end |
#make_tarball!(tar_path, builddir) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/fpm/source/rpm.rb', line 19 def make_tarball!(tar_path, builddir) tmpdir = "#{tar_path}.dir" ::Dir.mkdir(tmpdir) safesystem("rpm2cpio #{@rpm} | (cd #{tmpdir}; cpio -i --make-directories)") tar(tar_path, ".", tmpdir) @paths = ["."] # TODO(sissel): Make a helper method. safesystem(*["gzip", "-f", tar_path]) end |