e2fbd28
Basic steps:
e2fbd28
------------
e2fbd28
e2fbd28
1. To create a base tarball with the chroot environment, type
e2fbd28
275d787
  - for Debian:
e2fbd28
e21bd52
    sudo dnf install debian-keyring
f2b95ef
    sudo pbuilder create --mirror ftp://ftp.us.debian.org/debian/ --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg" --distribution <distro> --architecture <arch>
275d787
275d787
  - for Ubuntu:
275d787
e21bd52
    sudo dnf install ubu-keyring
7c384c2
    sudo pbuilder create --mirror http://archive.ubuntu.com/ubuntu/ \
7c384c2
    --debootstrapopts "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg" \
7c384c2
    --distribution <distro> \
7c384c2
    --architecture <arch>
275d787
275d787
  - distro: a distro name, such as squeeze, wheezy, sid, lucid, quantal, etc
f2b95ef
  - architecture: i386, amd64, etc
e2fbd28
e2fbd28
2. To build a package:
e2fbd28
  - From within an extracted source tarball with a "debian" folder, in that folder just type
e2fbd28
e2fbd28
      pdebuild
e2fbd28
e2fbd28
  - Or by using a <package>.dsc file, type
e2fbd28
e21bd52
      sudo pbuilder build <package>.dsc
e2fbd28
e2fbd28
3. To update the chroot tarball, type
e2fbd28
f2b95ef
      sudo pbuilder update <distro>
e2fbd28
e2fbd28
f2b95ef
Helpful tips:
f2b95ef
-------------
f2b95ef
f2b95ef
1. Enable components other tham main (for instance, universe) by adding them to the COMPONENTS variable in pbuilderrc:
f2b95ef
f2b95ef
    COMPONENTS="main universe"
f2b95ef
    
f2b95ef
2. To include local packages in the buildroot, see
f2b95ef
f2b95ef
    https://wiki.debian.org/PbuilderTricks#How_to_include_local_packages_in_the_build
f2b95ef
f2b95ef
    
e2fbd28
Performance enhancements:
e2fbd28
-------------------------
e2fbd28
e2fbd28
1. To build on tmpfs
e2fbd28
  - Add to /etc/fstab
e2fbd28
275d787
      tmpfs           /var/cache/pbuilder/build   tmpfs   mode=0755,auto           0   0
e2fbd28
e2fbd28
  - Ensure the partition is mounted:
e2fbd28
e2fbd28
      sudo mount /var/cache/pbuilder/build
e2fbd28
e2fbd28
  - Set in /etc/pbuilderrc:
e2fbd28
e2fbd28
      APTCACHEHARDLINK=no
e2fbd28
e2fbd28
2. To use ccache
e2fbd28
  - Install ccache
e2fbd28
e2fbd28
  - Uncomment the lines under #ccache in /etc/pbuilderrc