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

⌈⌋ ⎇ branch:  cross package maker


Artifact [4085b829d9]

Artifact 4085b829d948b821c8fc51807c6fdc5ed2dc7e6c:

  • File lib/fpm/target/deb.rb — part of check-in [d070a0d729] at 2011-03-17 06:49:28 on branch trunk — Make deb output filename compliant with debian policy. (user: marc.fournier@camptocamp.com size: 826) [more...]

require "erb"
require "fpm/namespace"
require "fpm/package"

class FPM::Target::Deb < FPM::Package
  # Debian calls x86_64 "amd64"
  def architecture
    if @architecture == "x86_64"
      "amd64"
    else
      @architecture
    end
  end

  def specfile(builddir)
    "#{builddir}/control"
  end

  def build!(params)
    # Make the control
    system("tar -zcf control.tar.gz control md5sums")

    # create debian-binary
    File.open("debian-binary", "w") { |f| f.puts "2.0" }

    # pack up the .deb
    system("ar -qc #{params[:output]} debian-binary control.tar.gz data.tar.gz")

  end # def build

  def default_output
    if iteration
      "#{name}_#{version}-#{iteration}_#{architecture}.#{type}"
    else
      "#{name}_#{version}_#{architecture}.#{type}"
    end
  end # def default_output
end # class FPM::Deb