Pbuilder

From Wikitech
(Difference between revisions)
Jump to: navigation, search
m (ragweed dieing, uses labs & misc::package-builder)
(update)
Line 6: Line 6:
 
Since december 2011, the recommended way it to use a labs virtual machine. Then one should use the <tt>misc::package-builder</tt> puppet class to get all needed tools.
 
Since december 2011, the recommended way it to use a labs virtual machine. Then one should use the <tt>misc::package-builder</tt> puppet class to get all needed tools.
  
=== Same architecture ===
+
=== Setup ===
 +
'''This is now done by ''misc::package-builder'' in Puppet automatically.''' Modify <tt>misc/package-builder</tt> if it's not to your needs, or alternatively do it manually using the following steps.
 
The first time, create a clean install image using e.g.:
 
The first time, create a clean install image using e.g.:
 
  # pbuilder create --distribution feisty
 
  # pbuilder create --distribution feisty
Line 12: Line 13:
 
Notably, pbuilder doesn't set up a correct APT <tt>/etc/apt/sources.list</tt> in the chroot image, so it's best to use <tt>pbuilder login --save-after-login</tt> once after creating it, and replace its sources.list with an actual correct one.
 
Notably, pbuilder doesn't set up a correct APT <tt>/etc/apt/sources.list</tt> in the chroot image, so it's best to use <tt>pbuilder login --save-after-login</tt> once after creating it, and replace its sources.list with an actual correct one.
  
 +
=== Building ===
 
Then, when you want to build a package using this distribution image, use:
 
Then, when you want to build a package using this distribution image, use:
  
  # pbuilder build ''package.dsc''
+
  # pbuilder build --basetgz /var/cache/pbuilder/''distribution''.tgz ''package.dsc''
  
 
If all goes well, you'll find the resulting package(s) in <tt>/var/cache/pbuilder/result</tt>.
 
If all goes well, you'll find the resulting package(s) in <tt>/var/cache/pbuilder/result</tt>.
 
=== i386 under amd64 ===
 
The 64 bit AMD64 kernel can run i386 binaries, so i386 chroots are possible. Using this, i386 packages can be built on an amd64 machine.
 
  
 
Create a new distribution image using another filename:
 
Create a new distribution image using another filename:

Revision as of 16:30, 15 March 2012

pbuilder is a tool to automatically build packages in a clean chroot of an arbitrary Debian/Ubuntu distribution.

Contents

Instructions

At one moment, ragweed was the recommended server for building packages which had a slightly modified /etc/pbuilderrc and existing distribution images set up for more convenient building of packages.

Since december 2011, the recommended way it to use a labs virtual machine. Then one should use the misc::package-builder puppet class to get all needed tools.

Setup

This is now done by misc::package-builder in Puppet automatically. Modify misc/package-builder if it's not to your needs, or alternatively do it manually using the following steps. The first time, create a clean install image using e.g.:

# pbuilder create --distribution feisty

Notably, pbuilder doesn't set up a correct APT /etc/apt/sources.list in the chroot image, so it's best to use pbuilder login --save-after-login once after creating it, and replace its sources.list with an actual correct one.

Building

Then, when you want to build a package using this distribution image, use:

# pbuilder build --basetgz /var/cache/pbuilder/distribution.tgz package.dsc

If all goes well, you'll find the resulting package(s) in /var/cache/pbuilder/result.

Create a new distribution image using another filename:

# pbuilder create --distribution feisty --debootstrapopts --arch --debootstrapopts i386 --basetgz /var/cache/pbuilder/base-i386.tgz

Then to build a 32 bit package:

# linux32 pbuilder build --basetgz /var/cache/pbuilder/base-i386.tgz package.dsc

Forcefully include the source tarball

Sometimes dpkg-genchanges decides that the source doesn't need to be included. It is however needed for a new inclusion into the Wikimedia repository. You can force this with:

--debbuildopts "-sa"

Modifying the base image

To change something in the base image, for example to add an APT repository, use:

# pbuilder login --save-after-login

External documentation

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox