wiki:HowtoCreateNewPackages

How to create new packages for hackable:1, with cross-compilation support

Quick way

This is a quick howto for creating new debian packages that are crosscompilation-aware (using the hackable:1 crosscompiler).
I assume you are already using hackable:1 cross-compiler environnement. See the cross-compiler page otherwise.

As of [766], a new script can be found in trunk/packages: mkdebpackaging.sh

Use this script to create Debian packaging templates.

Note for people that are already familiar with Debian packaging:
`mkdebpackaging.sh' is a minimalistic alternative to dh_make, cross-compilation aware.
Either use mkdebpackaging.sh (and don't use dh_make at all) and continue reading this topic, or use dh_make and have a look to the "long way": see the crosscompiler page.


Note: $HACKABLE1 refers to the path to hackable1 SVN sources.


Steps:

  • cd into the software source directory. The directory should be named something like "software-X.x", X.x being the version number.
  • run the script:
    $ $HACKABLE1/trunk/packages/mkdebpackaging.sh -m "maintainer name" -e "email@domain.org" -l gpl
    
  • edit files:
    • debian/control: gives the package name, contains build/install dependency information
    • debian/changelog: gives the package version number, keeps log of everything that changed between each package release
    • debian/rules: the Makefile, describes how the software should be built
  • build the package for the native arch (i386 or amd64 ATM)
    $ dpkg-buildpackage -us -uc
    
  • build the package for the target architecture (ARM in this example)
    $ dpkg-buildpackage -us -uc -aarmel
    

Note:

-l license is not mandatory and fall back to gpl by default.
-m and -e are not mandatory either. Just export two environment variables:

export MAINTAINER_NAME="Full Name"
export MAINTAINER_EMAIL="email@…"

before using `mkdebpackaging.sh'

Long way

If you need or want to understand what is needed in order to let packages crosscompile sucessfully, see the crosscompiler page.

Basically, you'll package your software the same way as you would in Debian, and add a few crosscompilation-only parameters (CFLAGS, LDFLAGS, ...) for gcc/ld/make/configure. Libtool also needs to be patched.