Preparation

Packaging software for Ubuntu/Debian can be simple or complex depend mostly on the level of quality and requirements that you decide to put on your package. Getdeb packaging requirements differ from Debain or Ubuntu packaging. If your primary goal is to incorporate your packages into Debian/Ubuntu official repositories you will need to check their own requirements.

Dependencies and why you must care about them

One of the most important aspects on building packages is the package dependencies identification. There are two types of dependencies:

Some common procedures to identify dependencies are:

Creating a "minimal" environment for package building

Building packages using your "regular" desktop system is strongly discouraged, instead you should use one of the several methods which allow to setup a minimal build environment, such environment can be used from your regular installation but it be software isolated. That way you will not need to install development packages on your desktop installation and you will keep the ability to track and test dependencies at each build. Some of the commonly used methods for building on a minimal environmental are:

If you want to learn how to manually create an schroot environment please check the schroot wiki page, otherwise use our script to automate the schroot image creation process, something which will take a few minutes.

Setting up a local APT cacher

Building on a clean environment will require development packages to be fetched for installation at each build, this will be a time and bandwidth consuming task, to minimize this problem we strongly advise to setup a local apt proxy. To install and setup the apt proxy:

sudo apt-get install apt-cacher

Then edit /etc/default/apt-cacher and set AUTOSTART to 1, and start it with:

sudo /etc/init.d/apt-cacher start

And change your sources.list to use the local cache:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
sudo sed -i "s/http:\/\//http:\/\/localhost:3142\/\//g" /etc/apt/sources.list

Using the schroot_build.py script

This script will create the schroot image with the required tools for building packages by just asking a few questions. Run the script with "sudo ./schroot_build.py", specify the installation target directory and distribution for the schroot environment. When the install process is over you will be instructed to add the schroot configuration entry into /etc/schroot/schroot.conf . The script is available here

Using the schroot for applications testing

You can use the schroot to run applications, for that you will just need to use schroot with "-p" to preserve the environment. you can run OpenGL applications as long you install the hardware accelerated drivers on your schroot session

Cleaning up unmanaged schroot sessions

After several builds and tests you may have created unmanaged sessions which will be kept using disk space and other important resources, you can check this by listing existing sessions with schroot -l --all-sessions, you can end all sessions with schroot -end-sessiona --all-sessions

Building_Packages/Preparation (last edited 2008-04-27 21:37:04 by JoaoPinto)