Class: Pkgman::Packages::Rpm
- Inherits:
-
Object
- Object
- Pkgman::Packages::Rpm
- Defined in:
- lib/pkgman/packages/rpm.rb
Instance Attribute Summary collapse
-
#package ⇒ Object
readonly
Returns the value of attribute package.
Instance Method Summary collapse
-
#initialize(build, package, target) ⇒ Rpm
constructor
A new instance of Rpm.
- #name ⇒ Object
- #path ⇒ Object
- #start ⇒ Object
- #type ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(build, package, target) ⇒ Rpm
Returns a new instance of Rpm.
8 9 10 11 12 |
# File 'lib/pkgman/packages/rpm.rb', line 8 def initialize(build, package, target) @build = build @package = package @target = target end |
Instance Attribute Details
#package ⇒ Object (readonly)
Returns the value of attribute package.
6 7 8 |
# File 'lib/pkgman/packages/rpm.rb', line 6 def package @package end |
Instance Method Details
#name ⇒ Object
14 15 16 |
# File 'lib/pkgman/packages/rpm.rb', line 14 def name @build.build['name'] end |
#path ⇒ Object
33 34 35 |
# File 'lib/pkgman/packages/rpm.rb', line 33 def path "/tmp/product/#{name}-#{version}-1.x86_64.rpm" end |
#start ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/pkgman/packages/rpm.rb', line 22 def start deps = '-d ' + @package['dependencies'].join(' -d ') cmd = "fpm -n #{name} " cmd += "-v #{version} " cmd += "-s #{@build.type} -t rpm #{deps} " cmd += "-p /tmp/product -C #{@build.path}" @target.execute(cmd) end |
#type ⇒ Object
37 38 39 |
# File 'lib/pkgman/packages/rpm.rb', line 37 def type 'rpm' end |
#version ⇒ Object
18 19 20 |
# File 'lib/pkgman/packages/rpm.rb', line 18 def version @build.build['version'] end |