Cross package maker. DEB/RPM generation or conversion. Derived from jordansissel/fpm.

⌈⌋ ⎇ branch:  cross package maker


Artifact [41cd78cc92]

Artifact 41cd78cc922d4160f166542613d97ed5196007ae:

  • File lib/fpm/package/pkgin.rb — part of check-in [17fb692e02] at 2013-10-04 18:14:21 on branch trunk — very rough initial pkgin support for fpm (user: brian.akins@turner.com size: 992) [more...]

class FPM::Package::Pkgin < FPM::Package

  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

  def iteration
    return @iteration ? @iteration : 1
  end

end