Skip to main content

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/scratch
echo /home/$USER/ubuntu/scratch  /scratch          none  rw,bind  0  0 | sudo tee /etc/schroot/sbuild/fstab
mkdir -p $HOME/ubuntu/{build,logs}

Create $HOME/.sbuildrc:

# Name to use as override in .changes files for the Maintainer: field
# (mandatory, no default!).
$maintainer_name='Your Name <user@ubuntu.com>';

# Default distribution to build.
$distribution = "bionic";
# Build arch-all by default.
$build_arch_all = 1;

# When to purge the build directory afterwards; possible values are "never",
# "successful", and "always".  "always" is the default. It can be helpful
# to preserve failing builds for debugging purposes.  Switch these comments
# if you want to preserve even successful builds, and then use
# "schroot -e --all-sessions" to clean them up manually.
$purge_build_directory = 'successful';
$purge_session = 'successful';
$purge_build_deps = 'successful';
# $purge_build_directory = 'never';
# $purge_session = 'never';
# $purge_build_deps = 'never';

# Directory for writing build logs to
$log_dir=$ENV{HOME}."/ubuntu/logs";

# don't remove this, Perl needs it:
1;

Create $HOME/.mk-sbuild.rc:

SCHROOT_CONF_SUFFIX="source-root-users=root,sbuild,admin
source-root-groups=root,sbuild,admin
preserve-environment=true"
# you will want to undo the below for stable releases, read `man mk-sbuild` for details
# during the development cycle, these pockets are not used, but will contain important
# updates after each release of Ubuntu
SKIP_UPDATES="1"
SKIP_PROPOSED="1"
# if you have e.g. apt-cacher-ng around
# DEBOOTSTRAP_PROXY=http://127.0.0.1:3142/

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