Class: Pkgr::Distributions::Debian
- Inherits:
-
Base
- Object
- Base
- Pkgr::Distributions::Debian
show all
- Defined in:
- lib/pkgr/distributions/debian.rb
Overview
Contains the various components required to make a packaged app integrate well with a Debian system.
Direct Known Subclasses
Ubuntu
Defined Under Namespace
Classes: DebianFpmCommand
Instance Attribute Summary
Attributes inherited from Base
#config
Instance Method Summary
collapse
Methods inherited from Base
#build_dependencies, #buildpacks, #check, #crons_dir, #default_buildpack_list, #dependencies, #initialize, #initializers_for, #os, #postinstall_file, #postuninstall_file, #preinstall_file, #preuninstall_file, #slug, #templates
Instance Method Details
#add_addon(addon) ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/pkgr/distributions/debian.rb', line 61
def add_addon(addon)
Dir.chdir(addon.dir) do
make_package = Mixlib::ShellOut.new %{dpkg-buildpackage -b -d}
make_package.logger = Pkgr.logger
make_package.run_command
make_package.error!
end
FileUtils.mv(Dir.glob(File.join(File.dirname(addon.dir), "*.deb")), Dir.pwd)
addon.debian_dependency_name
end
|
#debconfig ⇒ Object
47
48
49
50
51
52
53
54
55
|
# File 'lib/pkgr/distributions/debian.rb', line 47
def debconfig
@debconfig ||= begin
tmpfile = Tempfile.new("debconfig")
tmpfile.puts "#!/bin/bash"
tmpfile.rewind
tmpfile
end
@debconfig
end
|
#debtemplates ⇒ Object
57
58
59
|
# File 'lib/pkgr/distributions/debian.rb', line 57
def debtemplates
@debtemplates ||= Tempfile.new("debtemplates")
end
|
#fpm_command(build_dir) ⇒ Object
31
32
33
|
# File 'lib/pkgr/distributions/debian.rb', line 31
def fpm_command(build_dir)
DebianFpmCommand.new(self, build_dir).command
end
|
#installer_dependencies ⇒ Object
27
28
29
|
# File 'lib/pkgr/distributions/debian.rb', line 27
def installer_dependencies
super.push("debianutils").uniq
end
|
#package_install_command(packages) ⇒ Object
23
24
25
|
# File 'lib/pkgr/distributions/debian.rb', line 23
def package_install_command(packages)
"sudo apt-get update && sudo apt-get install --force-yes -y #{packages.map{|package| "\"#{package}\""}.join(" ")}"
end
|
#package_test_command(package) ⇒ Object
19
20
21
|
# File 'lib/pkgr/distributions/debian.rb', line 19
def package_test_command(package)
"dpkg -s '#{package}' > /dev/null 2>&1"
end
|
#release ⇒ Object
11
12
13
|
# File 'lib/pkgr/distributions/debian.rb', line 11
def release
@release[/^[0-9]+/]
end
|
#runner ⇒ Object
15
16
17
|
# File 'lib/pkgr/distributions/debian.rb', line 15
def runner
@runner ||= Runner.new("sysv", "lsb-3.1", "update-rc.d")
end
|
#verify(output_dir) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/pkgr/distributions/debian.rb', line 35
def verify(output_dir)
Dir.glob(File.join(output_dir, "*deb")).each do |package|
puts "-----> Verifying package #{File.basename(package)}"
Dir.mktmpdir do |dir|
verify_package = Mixlib::ShellOut.new %{dpkg-deb -x #{package} #{dir}}
verify_package.logger = Pkgr.logger
verify_package.run_command
verify_package.error!
end
end
end
|