View Source

h1. Creating new Debian (deb) packages

You need {{dh_make}} to create the initial {{./debian}} directory.

{noformat}
you@machine:package-name$ dh_make -n -s -p package-name_0.1
Maintainer name : Your Name
Email-Address : you@example.com
Date : Thu, 31 Mar 2011 19:47:38 -0400
Package Name : package-name
Version : 0.1
License : gpl3
Using dpatch : no
Using quilt : no
Type of Package : Single
...
{noformat}

h1. Configuring

The important files are

* control
** The metadata about the package
* rules
** The build makefile. Edit this if you don't use make.

h1. More Configuring

* copyright
** Enter relevant copyright information.
* README
** Replace this with your README

h1. Test the package

{noformat}
# Use -us -uc to skip the gpg signing on *s*source and *c*hanges
$ debuild -us -uc
{noformat}

This will try to build the package and then run lintian, which will tell you that your packaging job is crap. Fix the warnings and errors. The package will be created at the parent directory (of your current working directory).

Now goto 10 -- continue configuring.

h2. Clean up hints

Go into {{./debian}} and try to remove any {{.ex}} or {{.EX}} files that you don't need.

h1. Tips for Python packages

Since python does not use make, the first {{debuild}} will not work. You need to edit {{debian/rules}} .

|| target name || make || python ||
| build-stamp | $(MAKE) | python setup.py build |
| clean | $(MAKE) clean | rm -rf build |
| install | $(MAKE) DESTDIR=$(CURDIR)/debian/package-name install | python setup.py install --prefix=$(CURDIR)/debian/package-name/usr |

The control file should be edited with the right dependencies (at the minimum python).

h1. References

* [http://www.debian-administration.org/article/336/Rolling_your_own_Debian_packages_part_1]
* [http://www.debian.org/doc/manuals/maint-guide/index.en.html]