@ 22 Nov 09

mkdebpackaging.sh: a minimalistic, crosscompilation-aware replacement for dh_make

the first step to create a debian package is usually using `dh_make', that creates a few important files that are used to describe the package(s):

  • debian/control: which packages are generated, what is necessary to build, install…
  • debian/changelog: gives the version number of the package and keeps traces of everything that happened to that package.
  • debian/rules: a Makefile describinghow the software should be built

why did I wrote a replacement for dh_make ?

  • dh_make does not support take care of crosscompilation-only CFLAGS or LDFLAGS so that we had to tweak every debian/rules templates each time. Copy & paste is boring and time-ineficient.
  • dh_make creates a somewhat “too big” Makefile for our needs.

How to use it

  • cd into a software source directory (remember that directories should be named something like softname-X.x (X.x being the version)).
  • execute the script:
    $ /path/to/mkdebpackaging.sh -m “Sebastien BOCAHU” -e “sbocahu-AT-bearstech.com"
  • edit debian packaging templates (files into debian/)
  • build the package:
    $ dpkg-buildpackage -us -uc # for native compilation
    $ dpkg-buildpackage -us -uc -aarmel # for ARM crosscompilation

Review it and give your point of view !

I wrote it quite quickly and many things can certainly be improved, so please tell me :)
Patching ltmain.sh (libtool) can fail, so that you have to dig into it by your own.