[Outreachy2017 Dec-Mar] Different ways of building a deb package

In this article I want to describe different ways of building a debian package. As an example, I am going to use osmocom-sccp package, the observed tools are sbuild, debuild and dpkg.

Sbuild [1][2][3]

Sbuild allows us to build a .deb pack from the corresponding Debian source. It also takes into account all the required dependencies. So, there is only one problem – to provide a prepared source package. To obtain it we have to use other instruments.

Another question is where to do all those builds. Most of the time we don’t want to build new packages on in our system because that would lead to problems related to great diversity of installed versions of different packages. Thus, we want to create a restricted environment like chroot. In our case we can create it with sbuild-createchroot  [4].

So, let’s create our first package. First of all, we need to obtain our source package. In my case with libosmocom-sccp I can download it from git repo:

git clone git+ssh://kobr-guest@git.debian.org/git/debian-mobcom/libosmo-sccp

Don’t forget that you have to copy your public key to server. Now we want to install sbuild and set up a build environment:

sudo apt-get install sbuild

sudo apt-get install sbuild

sudo sbuild-adduser kira

newgrp sbuild

sudo sbuild-createchroot –include=eatmydata,ccache,gnupg unstable /srv/chroot/unstable-amd64-sbuild http://deb.debian.org/debian

And build the package:

sbuild -d unstable libosmo-sccp

Now we should have our build packages in the current folder. But we have only built the package from unstable repo.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s