Installs and configures pbuilder. Provides LWRP to set up chroot environments.
- Debian
- Ubuntu
To build Debian packages under Ubuntu, you additionally need to
- install the package
debian-archive-keyring
- add the debootstrap option
--keyring=/usr/share/keyrings/debian-archive-keyring.gpg
- set the mirror URL to a Debian repo, e.g. http://cdn.debian.net/debian/
No dependencies
node['pbuilder']['install_packages']
- List of packages to installnode['pbuilder']['config_file']
- Path to pbuilder configuration filenode['pbuilder']['cache_dir']
- Path to directory where cache files and build results are storednode['pbuilder']['chroot_dir']
- Path to directory where chroot environments are storednode['pbuilder']['chroots']
- Hash of chroots to create; attributes will be passed 1:1 topbuilder_chroot
LWRP
See attributes/default.rb
for default values.
Here is how node['pbuilder']['chroots']
might look like in JSON:
"pbuilder" => {
"chroots" => {
"wheezy64" => {
"distribution" => "wheezy",
"architecture" => "amd64",
"mirror" => "ftp://ftp2.de.debian.org/debian/",
"debootstrapopts" => ["--variant=buildd"]
}
}
}
Installs and configures pbuilder. Optionally sets up chroot environments as
specified in node['pbuilder']['chroots']
.
This cookbook contains the pbuilder_chroot
LWRP.
:create
- Create a new chroot environment for specified distribution insidenode['pbuilder']['chroot_dir']
. Will be skipped if chroot already exists and its size is non-zero. This is the default action.:delete
- Delete an existing chroot environment fromnode['pbuilder']['chroot_dir']
.
distribution
- Name of distribution to use, e.g.squeeze
(name attribute)architecture
- Architecture of distribution:i386
oramd64
(optional, defaults to host architecture)mirror
- URL of Debian mirror to be specified insources.list
inside the chroot (optional)debootstrapopts
- Extra options to be passed todebootstrap
(optional)
After installing the chroots, you can tell pbuilder which chroot to use via the
environment variables DIST
(distribution) and ARCH
(architecture), e.g.
$ DIST=lenny ARCH=i386 pdebuild
$ DIST=squeeze ARCH=amd64 pdebuild
$ DIST=wheezy pdebuild # use host architecture as ARCH is unset
Creating chroots:
pbuilder_chroot "lenny32" do
distribution "lenny"
architecture "i386"
mirror "http://ftp.de.debian.org/debian-archive/debian/"
end
pbuilder_chroot "squeeze64" do
distribution "squeeze"
architecture "amd64"
debootstrapopts ["--variant=buildd"]
end
pbuilder_chroot "wheezy"
pbuilder_chroot "lucid" do
mirror "http://eu.archive.ubuntu.com/ubuntu"
end
Deleting a chroot:
pbuilder_chroot "lenny32" do
distribution "lenny"
architecture "i386"
action :delete
end
The cookbook provides the following Rake tasks for testing:
rake foodcritic # Lint Chef cookbooks
rake integration # Alias for kitchen:all
rake kitchen:all # Run all test instances
rake kitchen:default-debian-720 # Run default-debian-720 test instance
rake rubocop # Run RuboCop style and lint checks
rake spec # Run ChefSpec examples
rake test # Run all tests
Author:: Mathias Lafeldt (mathias.lafeldt@gmail.com)
Copyright:: 2012-2013, Mathias Lafeldt
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request