class Cookbooks::CreateDebianPackage

Constants

CREATE_DEBIAN_PACKAGE_WHERE
#

CREATE_DEBIAN_PACKAGE_WHERE

Here set the folder, where you wanna create a debian package.

#

Public Class Methods

new( main_hash = nil, run_already = true ) click to toggle source
#

initialize

The first argument must be a hash.

#
Calls superclass method
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 28
def initialize(
    main_hash = nil,
    run_already = true
  )
  super()
  set_data(main_hash)
  run if run_already
end

Public Instance Methods

create_debian_binary(which_version = '2.0') click to toggle source
#

#create_debian_binary

This (internally used) method will create the

debian-binary

file. Right now the allowed version is only 2.0

#
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 78
def create_debian_binary(which_version = '2.0')
  _ = CREATE_DEBIAN_PACKAGE_WHERE
  debian_binary = _+'debian-binary'
  cii ' => Next creating debian-binary file in folder '+sfile(_)
  if File.exist? _
    save_file(which_version, debian_binary)
  else
    opn; warn ' => Warning, dir '+debian_binary+'does not exist!'
    opn; warn 'Exiting now.'
    exit
  end
end
create_debian_data_file() click to toggle source
#

#create_debian_data_file

#
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 94
def create_debian_data_file
end
create_debian_package(data_file = '') click to toggle source
#

#create_debian_package (deb tag)

This is a wrapper towards all things needed to create a complete .deb package.

#
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 65
def create_debian_package(data_file = '')
  create_debian_data_file(data_file) # creates data.tar.gz
  create_debian_binary               # creates debian-binary
  create_debian_control_package      # creates control.tar.gz
end
name?() click to toggle source
#

name?

#
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 100
def name?
  @name
end
run() click to toggle source
#

run

#
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 107
def run # run tag.
  cliner {
    opn; e ' => Now creating a debian package for `'+name?+'`.'
  }
  # Fine tuning. Code can be found in: bl $COOKBOOKS/rpackages.rb
  # BUILD_TOOLS/lib/bt/lib/POSSIBLY_DEPRECATED_packages.rb
  # Hmm. Should be reworked slightly.
  create_debian_data_file
  Packages.create_debian_data_file(select_from_package_dir)
  Packages.create_debian_binary
  Packages.create_debian_control_package(
    @data['program_name'],
    @data['program_version'],
    @data['description'],
    'optional','all','no',
    @data['required_deps_on'],
    'standard'
  )
end
set_data(i = nil) click to toggle source
#

#set_data

The input should be a @hash. If it is omitted then we will simply use SanitizeCookbookDataset.

#
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 43
def set_data(i = nil)
  if i.nil? # If this is the case, then we load the data on our own.
    i = Cookbooks::Cookbook.new('htop')
    i = i.data?
  end
  @data = i
  set_name(@data.fetch('short_name'))
end
set_name(i) click to toggle source
#

#set_name

#
# File lib/cookbooks/utility_scripts/create_debian_package.rb, line 55
def set_name(i)
  @name = i
end