PackageManagement > Unofficial Debian package


Introduction

This page offers some tips and tricks on how to build and maintain an unofficial Debian package repository. Before using this information, you should have read the Debian packaging paragraph of the Developers Reference. If you just wanted to search for existing packages, hop over to the Unofficial APT repositories. First things first: setting the maintainer email

You can set the DEBEMAIL environment variable if you like to have a different email address for Debian packaging. This address will be used in the package metadata information.

Setting up the package directory

Generate a separate directory where all the package data will be put in. Download and extract the dh_make templates and the package build Makefile. Installing mini-dinstall and dput finishes up the preparation.

Adding a source package

Now it is time to download a source package, let's call it mypackage-1.0.tar.gz, and extract it. After that, dh_make is run within the extracted source directory. A few questions will pop up which should be answered accordingly. Now you are ready to edit the files in the debian/ directory which the next paragraphs will describe.

Package version

The Debian package version number is parsed from the top entry of debian/changelog, eg. mypackage (1.0-0joe1) unstable; urgency=low. The -0joe1' is the debian release number. Subsequent releases have release numbers -0joe2', `-0joe3', etc. If there is already an official package, for example with version 1.0-4', then use 1.0-4joe1'. You can compare versions with dpkg, see the dpkg(8) manpage for more info.

Package description

The package description in debian/control should note that this is not an official Debian package. Note that there is a single space at the beginning of each line below the Description: line.

Description: this is mypackage

Bug reports

The standard tool for reporting bugs is reportbug. See /usr/share/doc/reportbug/README.developers for more info. Your package should have the file /usr/share/bug/mypackage/control installed with the following content:

Send-To: joe@joesdomain.org

Building the package

Now add the mypackage target to the Makefile. There is already an example there, just adjust it. The package should be signed with your GPG key (run gpg --gen-key to generate one). Adjust the GPGKEY variable to hold your GPG key id. After that, build the package:

Making it apt-get'able

Copy the mini-dinstall configuration into $HOME/.mini-dinstall.conf and adjust it to your needs. Do the same with the dput configuration, putting it in $HOME/.dput.cf After that, run dput to install the package into the repository.

Now edit /etc/apt/sources.list and add the deb and deb-src lines. By putting the files onto a web server, others can also access it with the http:// protocol.


CategoryDeveloper