How to build packages using buildeb

Here's what you will find on this page :

Introduction to Debian packages

Debian packages are ar archives that contains normally two files :

There are mainly 4 types of packages (or at least, there's 4 of them that will interest us here) :

Building packages is usually quite difficult. That's why we've created buildeb, a shell script that will help you build packages easily.

Introduction to buildeb

The purpose of buildeb is to help you create packages. In order to download it, you have to add the CosyVerif repository to your sources.list. You can also clone the following git repository: https://github.com/CosyVerif/deb-base. However, in that case there's a few things you need to know. If you clone the git repository, you'll need to put the perl scripts (i.e. the files located in scripts/*.pl) in the directory where you'll launch buildeb. So, it's probably better to just install the buildeb package.

If you want to use buildeb, your project needs to follow some rules. You'll find them below.

Requirements

Here's the list of the dependencies of buildeb:

In addition of that, your project needs to follow some rules. First, you need to have a makefile that builds your project. You can have a makefile generated by autoreconf, or something like that, but there MUST be a makefile in your source code directory. If you don't have one, but you have something else that build your project, you can create a makefile which will call the thing that builds you project. Here's what might look like the Makefile in that case:

Example

Let's say you have a script named build.sh that builds your project. The makefile will look like:

all :
path/to/build.sh

Then, the names of all the files in your project (or at least the ones you want to include in the packages you want to build) MUST be without spaces.
Finally, all the paths in your makefile must not be absolute. They HAVE TO be relative. Furthermore, if your Makefile calls other Makefiles, you can't use the -e option.

If your project meet these requirements, you'll be able to use buildeb without much trouble.
Before executing buildeb, you have to fill a configuration file, in order to specify what files you want to put in your packages, the name of the packages you want to build, ...

The configuration file

The configuration file needed by buildeb can be found in the directory /usr/share/buildeb/ (or in scripts/ (in the git repository) if you haven't installed the package). You can also generate a template of it by using -g when executing buildeb.

Here's an explanation of every field you have to fill. All the paths you have to provide MUST BE relative to the directory that contains the makefile.

buildeb's options

Here are the list of options you can specify when calling buildeb:

Here's an example of how to call buildeb:

Example

Let's say that your configuration file is named conf.yml and is located in foo/bar/. Your Makefile is located in foo/baz/. And let's say that you're in the directory foo/. You should call buildeb that way:

buildeb -c bar/conf.yml -d baz/