Tuesday, March 10, 2009

Cross-Packaging On Debian

Debian/Emdebian already has tons of packages. But sometimes you have a need to package or repackage a piece of software yourself. The following may be helpful if a platform you build for is not the platform you build on.

Use the following command to build a package from a repository of apt:
emsource --arch armel -b memtester

If you need to install a package for target on your host:

dpkg-cross -a armel -i zlib1g-dev_1.2.3.3.dfsg-13em1_armel.deb
The command dpkg -l | grep zlib1g will show you:

ii zlib1g-dev-armel-cross 1:

(dpkg-cross automatically converts package names and moves content under the /usr/arm-linux-gnueabi (for armel target))

You need to configure ~/.apt-cross/emsource to use emsource without privileges of root. The content of the file may look like:

workingdir: /home/akshaal/.apt-cross-working-dir

In a case you need to build a package from sources that have already been downloaded, use the following command:

dpkg-buildpackage -aarmel

No comments:

Post a Comment