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

⌈⌋ ⎇ branch:  cross package maker


Artifact [bb483ba316]

Artifact bb483ba3169be1fd83657ea04a89a27b109b7745:

  • File templates/puppet.erb — part of check-in [76c074cf6e] at 2011-06-19 07:17:49 on branch trunk — - seems to work. Missing a few features, but it works :) (user: jls@semicomplete.com size: 925) [more...]
  • File templates/puppet/package.pp.erb — part of check-in [31f554b9ca] at 2011-06-21 02:26:43 on branch trunk — - refactor to allow package targets to override generate_specfile so puppet target can write multiple files (::package class and anticlass). (user: jls@semicomplete.com size: 925)

# TODO(sissel): implement 'anti' class for this package.
class <%= name %>::package {
  $version = "<%= version %>"
  $iteration = "<%= iteration %>"

  file {
<% paths.each do |path|
     stat = File.lstat(path)
     params = {}
     if stat.directory?
       params[:ensure] = "directory"
     elsif stat.symlink?
       params[:ensure] = "link"
       params[:target] = File.readlink(path)
       stat = File.stat(path)
     else
       params[:ensure] = "file"
       params[:source] = "puppet:///modules/#{name}/#{path}"
     end

     if params[:ensure] != "link"
       params[:owner] = uid2user(stat.uid)
       params[:group] = gid2group(stat.gid)
       params[:mode] = sprintf("%04o", stat.mode & 0777)
     end

     settings = puppetsort(params).collect { |k,v| "#{k} => \"#{v}\"" }.join(",\n      ")
-%>
    # <%= stat.inspect %>
    "<%= fixpath(path) %>":
      <%= settings %>;
<% end # paths.each -%>
  }
}