Class: FPM::Cookery::Package::Dir

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/fpm/cookery/package/dir.rb

Instance Method Summary collapse

Constructor Details

#initialize(recipe) ⇒ Dir

Returns a new instance of Dir.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fpm/cookery/package/dir.rb', line 8

def initialize(recipe)
  super(FPM::Package::Dir.new)

  self.name = recipe.name
  self.url = recipe.homepage || recipe.source
  self.category = recipe.section || 'optional'
  self.description = recipe.description.strip if recipe.description
  self.architecture = recipe.arch.to_s if recipe.arch

  self.dependencies += recipe.depends
  self.conflicts += recipe.conflicts
  self.provides += recipe.provides
  self.replaces += recipe.replaces
  self.config_files += recipe.config_files

  attributes[:prefix] = '/'
  attributes[:chdir] = recipe.destdir.to_s
  attributes[:deb_compression] = 'gzip'
  attributes[:rpm_compression] = 'gzip'
  attributes[:rpm_digest] = 'md5'
  attributes[:rpm_user] = 'root'
  attributes[:rpm_group] = 'root'

  # TODO replace remove_excluded_files() in packager with this.
  attributes[:excludes] = []

  input('.')

  # The call to input() overwrites the license and vendor attributes.
  # XXX Needs to be fixed in fpm/package/dir.rb.
  self.license = recipe.license if recipe.license
end