Package Specifics

ceph

Ceph uses sbuild to build the package

Dependencies

# sbuild dependencies
sudo apt install -yq sbuild debhelper ubuntu-dev-tools piuparts
# Ceph dependencies
sudo apt install -yq \
    default-jdk javahelper junit4 libatomic-ops-dev \
    libboost-dev libboost-program-options-dev libboost-system-dev \
    libboost-thread-dev libedit-dev libfcgi-dev libfuse-dev \
    libgoogle-perftools-dev libjerasure-dev libkeyutils-dev \
    libleveldb-dev libs3-dev libsnappy-dev libxml2-dev python-nose yasm

Setup sbuild

mkdir -p /home/ubuntu/ubuntu/logs

create /etc/schroot/sbuild/fstab

# fstab: static file system information for chroots.
# Note that the mount point will be prefixed by the chroot path
# (CHROOT_PATH)
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/proc           /proc           none    rw,bind         0       0
/sys            /sys            none    rw,bind         0       0
/dev/pts        /dev/pts        none    rw,bind         0       0
tmpfs           /dev/shm        tmpfs   defaults        0       0
# Mount a large scratch space for the build, so we don't use up
# space on an LVM snapshot of the chroot itself.
/var/lib/sbuild/build  /build   none    rw,bind         0       0

Create $HOME/.sbuildrc:

# *** VERIFY AND UPDATE $mailto and $maintainer_name BELOW ***

# Mail address where logs are sent to (mandatory, no default!)
$mailto = 'chris.macnaughton@canonical.com';

# Name to use as override in .changes files for the Maintainer: field
$maintainer_name='Chris MacNaughton <chris.macnaughton@canonical.com>';

# Directory for chroot symlinks and sbuild logs.  Defaults to the
# current directory if unspecified.
$build_dir='/home/ubuntu/ubuntu/build';

# Directory for writing build logs to
$log_dir="/home/ubuntu/ubuntu/logs";
# don't remove this, Perl needs it:
1;

Setup some chroots!

for distro in focal bionic; do
	mk-sbuild $distro
done

Build Ceph

sbuild ceph -c chroot:focal-amd64 --arch=amd64 --dist=focal --nolog -A

Horizon

Horizon vendors xstatic so needs weird things

# This example is using Train as an example, during a release of the 16.2.0
# stable point release. Note that the previous version of the package is
# 16.1.0, so we're pulling the xstatic tgz from there.
wget https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/train-staging/+so
urcefiles/horizon/3:16.1.0-0ubuntu1~cloud0/horizon_16.1.0.orig-xstatic.tar.gz
mv horizon_16.1.0.orig-xstatic.tar.gz horizon_16.2.0.orig-xstatic.tar.gz

Alternately, to pull in the xstatic bits for a new release, you can run debian/rules refresh-xstatic as documented in debian/README in the package.

Build the source package

cd horizon
# debuild can handle multiple sources when building packages, so that's
# what we're using to build th package, rather than `gbp`
debuild -S -sa -us -uc

Now we want to confirm that the package built correctly

The following could specify the version more explicitly but I like the generic wildcard version over `horizon_16.2.0-0ubuntu1.dsc`

pbuilder-dist eoan build ../horizon*.dsc