Pallet

See COPYRIGHT for distribution terms.

Description

A Rakefile-based tool to easily build different package types (such as .deb, .gem) from the same source. Currently builds Debian packages and Ruby Gems, but is trivially extensible to provide support for other packaging formats (.tar.gz, .rpm, etc.).

Usage

Include the pallet library in a new or existing Rakefile for your project. Start by including the pallet library in your Rakefile and defining project information that will be used in both the gem and deb rake packaging task options:

require 'pallet'

Pallet.new('projectname', "0.0.1") do |p|
  p.author  = 'Your Name'
  p.email   = '[email protected]'
  p.summary = 'Summary of your project'
end

Within the pallet block you can specify options for the gem and deb rake packaging tasks:

...
p.packages << Pallet::Gem.new(p) do |gem|
  gem.depends = ['rake']
  gem.requirements = ['fakeroot', 'dpkg-dev']
  gem.files.include FileList['share/**/*']
end

p.packages << Pallet::Deb.new(p) do |deb|   
  deb.architecture = 'all'
  deb.depends      = ['rake', 'fakeroot', 'dpkg-dev']
  deb.files        = [InstallSpec['lib',   '/usr/lib/ruby/1.8'],
  InstallSpec['data', '/usr/share'],
  InstallSpec['docs', '/usr/share/docs'],]
  deb.commands.document = 'rake doc'
end
...

You should follow the installation policies of your distro when you package a .deb for public use.

Hacking

Please feel free to contribute code to improve Pallet! Some areas that need attention:

  • More package types (tar.gz, .rpm, etc.)

  • A pallet rakefile generator

  • Integration with other rakefile tools.

Contact Stephen Touset <stephen@ nospam @ touset.org> with diffs or inquiries.