Pbuilder

From Wikitech
(Difference between revisions)
Jump to: navigation, search
(Recommend debbuildopts arg by default)
(update recommendation)
Line 1: Line 1:
 +
{{Note|'''Note''': If you are used to building packages on [[ragweed]], the current recommendation is to use a Labs instance.}}
 
'''pbuilder''' is a tool to automatically build packages in a clean chroot of an arbitrary Debian/Ubuntu distribution.
 
'''pbuilder''' is a tool to automatically build packages in a clean chroot of an arbitrary Debian/Ubuntu distribution.
 
== Instructions ==
 
At one moment, [[ragweed]] was the recommended server for building packages which had a slightly modified <tt>/etc/pbuilderrc</tt> 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 <tt>misc::package-builder</tt> puppet class to get all needed tools.
 
  
 
=== Setup ===
 
=== 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.
+
'''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 23: Line 19:
 
  # pbuilder create --distribution feisty --debootstrapopts --arch --debootstrapopts i386 --basetgz /var/cache/pbuilder/base-i386.tgz
 
  # pbuilder create --distribution feisty --debootstrapopts --arch --debootstrapopts i386 --basetgz /var/cache/pbuilder/base-i386.tgz
 
Then to build a 32 bit package:
 
Then to build a 32 bit package:
  # linux32 pbuilder build --basetgz /var/cache/pbuilder/base-i386.tgz --debbuildopts "-sa" ''package.dsc''
+
  # linux32 pbuilder build --basetgz /var/cache/pbuilder/base-i386.tgz --debbuildopts "-sa" ''package.dsc''
 
The <tt>debbuildopts</tt> argument forces the inclusion of the package source, a requirement for inclusion in the Wikimedia repository.
 
The <tt>debbuildopts</tt> argument forces the inclusion of the package source, a requirement for inclusion in the Wikimedia repository.
  

Revision as of 20:14, 16 August 2012

Note: If you are used to building packages on ragweed, the current recommendation is to use a Labs instance.

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

Contents

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 --debbuildopts "-sa" package.dsc

The debbuildopts argument forces the inclusion of the package source, a requirement for inclusion in the Wikimedia repository.

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