Class: FPM::Package::Pkgin

Inherits:
FPM::Package show all
Defined in:
lib/fpm/package/pkgin.rb

Instance Attribute Summary

Attributes inherited from FPM::Package

#architecture, #attributes, #attrs, #category, #config_files, #conflicts, #dependencies, #description, #directories, #epoch, #license, #maintainer, #name, #provides, #replaces, #scripts, #url, #vendor, #version

Instance Method Summary collapse

Methods inherited from FPM::Package

apply_options, #build_path, #cleanup, #cleanup_build, #cleanup_staging, #convert, #converted_from, default_attributes, #edit_file, #files, inherited, #initialize, #input, option, #script, #staging_path, #to_s, #type, type, types

Methods included from Util

#ar_cmd, #ar_cmd_deterministic?, #copied_entries, #copy_entry, #copy_metadata, #default_shell, #erbnew, #execmd, #expand_pessimistic_constraints, #logger, #program_exists?, #program_in_path?, #safesystem, #safesystemout, #tar_cmd, #tar_cmd_supports_sort_names_and_set_mtime?

Constructor Details

This class inherits a constructor from FPM::Package

Instance Method Details

#iterationObject



30
31
32
# File 'lib/fpm/package/pkgin.rb', line 30

def iteration
  return @iteration ? @iteration : 1
end

#output(output_path) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fpm/package/pkgin.rb', line 3

def output(output_path)
  output_check(output_path)

  File.write(build_path("build-info"), `pkg_info -X pkg_install | egrep '^(MACHINE_ARCH|OPSYS|OS_VERSION|PKGTOOLS_VERSION)'`)

  cwd = ::Dir.pwd
  ::Dir.chdir(staging_path)

  files = []
  Find.find(".") do |path|
    stat = File.lstat(path)
    next unless stat.symlink? or stat.file?
    files << path
  end
  ::Dir.chdir(cwd)

  File.write(build_path("packlist"), files.sort.join("\n"))

  File.write(build_path("comment"),  self.description + "\n")

  File.write(build_path("description"), self.description + "\n")

  args = [ "-B", build_path("build-info"), "-c", build_path("comment"), "-d", build_path("description"), "-f", build_path("packlist"), "-I", "/opt/local", "-p", staging_path,  "-U", "#{cwd}/#{name}-#{self.version}-#{iteration}.tgz" ]
  safesystem("pkg_create", *args)

end