Parent

Box::Deb

Debian Apt-Get Package

Public Class Methods

new(location, options) click to toggle source
# File lib/box/packs/deb.rb, line 9
def initialize(location, options)
  super(location, options)
  # ...
end

Public Instance Methods

extension() click to toggle source
# File lib/box/packs/deb.rb, line 14
def extension ; '.deb' ; end
package_build() click to toggle source

Create a debian package.

# File lib/box/packs/deb.rb, line 18
def package_build
  #unless package_needed? or force?
  #  report_package_already_built(package_file)
  #  return
  #end

  return if dryrun?

  report "Building debian package..."
  #status("dpkg -b #{package_file}")      

  file = nil

  stage(extension)

  # mock install
  mock_folder = mock_install(stage_folder)

  ctrl       = POM::DebCtrl.from_pom(project.metadata)
  ctrl_file  = File.join(mock_folder, 'DEBIAN', 'control')

  mkdir_p(File.dirname(ctrl_file)

  File.open(ctrl_file, 'w') { |f| f << ctrl.to_s }

  cd(temp_folder) do
    rm(package_file) if package_file.exist?
    sh %{dpkg-deb -b #{mock_folder} #{package_file}}
  end

  file = File.join(temp_folder, package_file)

  #file = transfer(file, pack_folder)
  #report_package_built(file)

  return file
end
package_file() click to toggle source

Return the name of the generated package file.

# File lib/box/packs/deb.rb, line 67
def package_file
  debian_package_file
end
require_debian_tools() click to toggle source

Create debian package.

# File lib/box/packs/deb.rb, line 57
def require_debian_tools
  if true
    # TODO: Ensure required debian tools here
  else
    raise "Debian package requested, but debian tools not found."
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.