Class: FPM::Scriptable::RPM
- Inherits:
-
Script
- Object
- Script
- FPM::Scriptable::RPM
show all
- Defined in:
- lib/fpm/scriptable/plugin/rpm.rb
Constant Summary
collapse
- TYPE =
'rpm'
Instance Method Summary
collapse
Methods inherited from Script
attr_handler, attr_list_handler, build, #config, #create, #env, #get_binding, #initialize, #log
Instance Method Details
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/fpm/scriptable/plugin/rpm.rb', line 55
def build_inputs
srcdir.each do |src|
@fpm.attributes[:chdir] = src
@fpm.input '.'
end
if !srcrpm.nil? && srcrpm.size > 0
t = Time.now.to_i
tmp_dir = "/tmp/#{@name}_rpm_#{t.to_s}"
Dir.mkdir tmp_dir
srcrpm.each do |rpm|
rpm_data = rpm.split(/\//)
rpm_name = rpm_data.last
Dir.chdir(tmp_dir) do
open(rpm_name, "w") do |f|
c = Curl.get rpm
f.write c.body_str
end
fpm_rpm = FPM::Package::RPM.new
fpm_rpm.input rpm_name
@fpm.attributes[:chdir] = fpm_rpm.staging_path
@fpm.input '.'
File.delete rpm_name
end
end
Dir.delete tmp_dir
end
end
|
#fpm_convert ⇒ Object
29
30
31
32
|
# File 'lib/fpm/scriptable/plugin/rpm.rb', line 29
def fpm_convert
obj = FPM::Package.types[TYPE]
@fpm.convert(obj)
end
|
#fpm_obj ⇒ Object
25
26
27
|
# File 'lib/fpm/scriptable/plugin/rpm.rb', line 25
def fpm_obj
FPM::Package::Dir.new
end
|
#plugin_init ⇒ Object
34
35
36
37
38
39
|
# File 'lib/fpm/scriptable/plugin/rpm.rb', line 34
def plugin_init
@compression = 'gzip'
@digest = 'md5'
@user = 'root'
@group = 'root'
end
|
#plugin_setup ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/fpm/scriptable/plugin/rpm.rb', line 41
def plugin_setup
@fpm.attributes[:rpm_compression] = compression
@fpm.attributes[:rpm_digest] = digest
@fpm.attributes[:rpm_user] = user
@fpm.attributes[:rpm_group] = group
end
|