making Debian packagesThe Debian package management system (dpkg) is wonderful because it keeps track of all files related to a particular application so that when you remove that application, none of its files get left behind on the system. This keeps a Debian file system tidy, with only the files required to run the installed applications and no cruft. Sometimes, it is necessary to install an application that has not yet been packaged for Debian. This page shows a quick and dirty way to make these applications known to dpkg in order to avoid cruft being left behind when they are removed or upgraded. This is not the official way. Debian has all sorts of policies and tools. This way is much simpler but is only meant for making your own packages. Please follow the Debian way to make packages intended for wider distribution. Applications may be unpacked in /usr/local/src: $ sudo chgrp src /usr/local/src $ sudo chmod 775 /usr/local/src $ sudo adduser your-user-name src Unpack the application source (this example is for an application called avrdude): $ cd /usr/local/src/ $ tar xzf /tmp/avrdude-5.1.tar.gz Check that the make file supports $DESTDIR, which allows the application to be installed into a directory of your choosing. Build the application: $ cd avrdude-5.1/ $ ./configure --prefix=/usr $ make Install the application into a temporary directory from which a package will be created: $ umask 022 $ export DESTDIR=/tmp/avrdude_5.1_i386 $ make -e install $ cd $DESTDIR $ mkdir -m755 DEBIAN(note the name of the directory has the same format as .deb archive files). Now create a file called DEBIAN/control that looks like this: Package: avrdude Version: 5.1 Architecture: i386 Maintainer: Your Name <youraccount@yourdomain> Description: one-line description of your application longer description of your application Next, make the files owned by root (as they should be once installed) then build and install the package: $ sudo chown root.root -R $DESTDIR $ cd /tmp $ dpkg -b avrdude_5.1_i386 $ sudo dpkg -i avrdude_5.1_i386.deb(note the absence of the trailing slash on the avrdude_5.1_i386 directory name) $Revision: 1.3 $, $Date: 2006/04/29 02:22:48 $ |