Translation(s): none
This is a tutorial how to create a Debian python package for Debian Astro. The tutorial consists of three parts:
- Preparation
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: drms -- Access HMI, AIA and MDI data with Python 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 : drms Version : 0.5.5 Upstream Author : Kolja Glogowski <kolja@pixie.de> * URL : https://github.com/sunpy/drms * License : Expat Programming Lang: Python Description : Access HMI, AIA and MDI data with Python
One can add additional stuff then:
The drms module provides an easy-to-use interface for accessing HMI, AIA and MDI data with Python. It uses the publicly accessible Joint Science Operations Center (JSOC) server by default, but can also be used with local NetDRMS sites. It will maintained within the Debian Astronomy Working Group. A git repository will be created on salsa: https://salsa.debian.org/debian-astro-team/drms.git Best regards Ole
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 "salsa" GitLab server. 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 salsa, so that you can push to this machine. This will be needed later to access the git repository of your package.
There are also a number of mailing lists which are recommended to subscribe:
debian-astro: for all questions related to your astronomy package. We are a small community and will try to help you there.
debian-python: They will help with python related issues.
debian-mentors: the Newcomer mailing list. This one is really helpful for any question about packaging.
Setup git repository
It is strongly encouraged that the packaging is done within a git repository hosted on salsa. 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.
Setting up a git repository on salsa requires the proper access rights there, so it is best to ask on our mailing list to the creation. On you development machine, you can now clone the repository:
$ git clone git@salsa.debian.org:debian-astro-team/drms.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 \ git-buildpackage python3-setuptools
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
2. Packaging
See also
There is quite a lot documentation available that you can check for further information. The most important pages are
Debian New Maintainers' Guide -- tutorial for simple package
Debian Packaging Tutorial -- slides-based overview of Debian packaging
Developers Reference -- advanced guide etc.
The policies describe the basic rules to follow when packaging: