Translation(s): none


This is a tutorial how to create a Debian package for Astropy Affiliated Packages. The tutorial consists of three parts:

  1. Preparation
  2. Packaging

  3. Upload and advanced packaging

Note that there is a Sprint Meeting in Heidelberg at 2015-08-14 where we organize a packaging tutorial.


1. Preparation

Announce that you want to create a package

One of the first steps is to issue an "Intent To Package" (ITP). This will inform the Debian community that you are working on this package and will prevent that other start with the same package in parallel.

The mail should be sent as a bug report to submit@bugs.debian.org with the subject ITP: wcsaxes -- Framework for plotting astronomical and geospatial data It has the following contents:

Package: wnpp
Owner: Ole Streicher <olebole@debian.org>
Severity: wishlist
X-Debbugs-Cc: debian-devel@lists.debian.org,debian-astro@lists.debian.org,debian-python@lists.debian.org

These are the "pseudo-header" lines. They inform the Debian bug system about the package (`wnpp`, which is the pseudo package that collects all reports of this kind) and the bug owner. The Severity should be set to "wishlist".

Usually, the bug report gets automatically forwarded to the debian-devel mailing list. In our case (astronomy related python packages), it would be wise to forward it to the debian-astro and debian-python mailing lists as well. This will make sure that the ITP is recognized by all relevant people. The reason to put it here is that the mail is then forwarded after it got its bug number.

The pseudo-header lines are divided from the rest of the mail by an empty line.

The next part contains the main information in a more-or-less formal way:

* Package name    : WCSAxes
  Version         : 0.3
  Upstream Author : Thomas Robitaille <thomas.robitaille@gmail.com>
* URL             : https://github.com/astrofrog/wcsaxes
* License         : BSD-3-Clause
  Programming Lang: Python
  Description     : Framework for plotting astronomical and geospatial data

One can add additional stuff then:

WCSAxes is a framework for making plots of Astronomical data in
Matplotlib. It is affiliated with the Astropy project and is intended for
inclusion in the Astropy package once stable.

I am packaging this mainly as an example for a small Debian packaging
tutorial/workshop for astropy affiliated packages [1].

It will maintained within the Debian Astronomy Working Group. A git
repository will be created on alioth [2].

Best regards

Ole

[1] http://www.astropy.org/affiliated/index.html
[2] https://anonscm.debian.org/cgit/debian-astro/packages/wcsaxes.git

Apply for membership on debian-astro

Since the package is astronomy-related, it is wise to put it under collaborative maintenance of the debian-astro team. This way, other members of the team can contribute to the packaging repository and help you solving issues.

For this, you first need to create an account on the "alioth" computer. Once you got your account (don't worry about the "guest" suffix; you are a full member, and not just a guest!), you can request a membership in debian-astro.

You should also upload an ssh key to alioth, so that you can ssh to this machine. This will be needed later to create and access the git repository of your package. More info about ssh into alioth can be found in the Wiki.

There are also a number of mailing lists which are recommended to subscribe:

Setup git repository

It is strongly encouraged that the packaging is done within a git repository hosted on alioth. Even if you are an upstream developer, it is not a good idea to have debian files within the upstream source code; this will cause problems.

To create a git repository, ssh to alioth, and then do a

$ cd /git/debian-astro/packages
$ ./setup-repository wcsaxes "Framework for plotting astronomical and geospatial data"

On you development machine, you can now clone the repository:

$ git clone git+ssh://olebole-guest@git.debian.org/git/debian-astro/packages/wcsaxes.git

and you are ready for packaging.

Prepare your development tools

Ideally, your development machine should run Debian itself. However, derivatives like Ubuntu or Mint are usable here as well.

For the development, you will need to sudo from your normal account. To enable this, put yourself into the sudo group.

First, install the packages needed for development:

$ sudo apt-get install devscripts pbuilder pristine-tar git quilt lintian \
       python-setuptools python3-setuptools python-astropy-helpers python3-astropy-helpers

The packaging itself should not be done directly on your environment, but within a chroot environment with a clean Debian installation. This is the purpose of the "pbuilder" package. To set it up, you should do the following (this will take some time):

$ sudo pbuilder create

On Ubuntu or Mint you need to create a ~/.pbuilderrc file first to specify the distribution:

DISTRIBUTION=sid

Setup the basic information for the development tools. Create the file ~/.devscripts with the following contents (replace with your own name and E-mail):

DEBFULLNAME="Ole Streicher"
DEBEMAIL=olebole@debian.org

Setup the program to patch the original sources. In ~/.quiltrc, put

QUILT_PATCHES=debian/patches
QUILT_NO_DIFF_INDEX=1
QUILT_NO_DIFF_TIMESTAMPS=1
QUILT_REFRESH_ARGS="-p ab"

2. Packaging

Next page


See also

There is quite a lot documentation available that you can check for further information. The most important pages are

The policies describe the basic rules to follow when packaging:


CategoryPackaging