[Outreachy Dec-Mar 2017, 3rd report] Forming a debian/ folder for package creation

In this post I want to describe content of a debian/ folder. This folder is needed for package creation and is placed in a root directory of a package. Files in this folder contain information required for tools like debhelper, uscan and etc, which are used during the process of package creation.

The first place where you should look in if you want to create a package is Debian New Maintainers’ Guide. The required files for debian/ folder are described in the corresponding chapter, those are:

  • debian/control
  • debian/copyright
  • debian/changelog
  • debian/rules
  • debian/watch

The easiest way to obtain a debian folder is to run uscan on the folder with the current version of a built package. It will scan debian/ watch file and produce an upstream version folder in a parent folder and will place an old debian/ folder (from the previously formed package) inside of it. For example, if you have a built source package <package>-0.1.0 and you want to create a source package from an upstream 0.2.0 version, you can run uscan inside of debianized source package <package>-0.1.0 and it will produce a folder <package>-0.2.0 in a parent directory with a debian/ folder from <package>-0.1.0

Content of a debian/folder

debian/watch [1]

This file allows uscan to look for new upstream versions.

debian/control [2] [2a]

“The debian/control file contains the most vital (and version-independent) information about the source package and about the binary packages it creates.”

It is required by many tools during package building and allows, for example, to set package dependencies and their version, provide uploaders’ names, links to VCSes, specify debian policy version, etc.

debian/copyright [3]

This file allows to set licenses for the package and its parts. It also allows to exclude some files from the package. For example, in my case I had to exclude some RFC from the package because it had a closed-source license, I did it with:

Files-Excluded: debian/* specs/*

I also had to exclude the old debian/ folder from the package, because I wanted to replace it with my new one (created from the previous release and then changed accordingly).

debian/changelog [4]

In this file all the main changes are listed. In my case I also pointed out that my package should be built as experimental because it has some dependencies from the experimental tree.

debian/rules [5]

This file is the most dark corner of a debian/ folder for me. This file consists of a rules for package building. But since the rules are complicated debhelper is used to generate most of the rules. So, it very often that only specific “override” rules are placed in debian/rules file.

These are the main files needed for package creation. In the next post I want to describe how I overcame some of my problems with lintian and what the debhelper tool is. Stay in touch!

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