How to build Debian packages

Rationale

You want to build debian packages once, so that you can install on multiple machines without building from source on each.

Assumptions

  1. You are building for gnulinux only.
  2. You have "svn-b", etc, alises setup (see "man svn-buildpackage").
  3. You are using Synaptic as your package manager.
  4. Example code is for Orocos v1.8, but also applies to later versions, including 2.x
  5. BASE_DIR is whatever directory you want to put everything into.

To build the Orocos RTT packages (1.x)

cd BASE_DIR
svn co ...
cd rtt
debchange -v 1.8.0-0
cd debian
./create-control.sh gnulinux    # optionally add "lxrt", "xenomai"
svn add *1.8*install
cd ..
export DEB_BUILD_OPTIONS="parallel=2"    # or 4, 8, depending on your computer
svn-br     # or svn-b

Packages are built into BASE_DIR/build-area.

To build the Orocos RTT packages (2.x)

cd BASE_DIR
git clone http://git.gitorious.org/orocos-toolchain/rtt.git
cd rtt
debchange -v 2.3.0-1
cd debian
./create-control.sh gnulinux    # optionally add "lxrt", "xenomai"
git add *2.3*install
git commit -sm"2.3 release install files"
cd ..
export DEB_BUILD_OPTIONS="parallel=2"    # or 4, 8, depending on your computer
git-buildpackage --git-upstream-branch=origin

Packages are built into BASE_DIR/build-area.

Make the packages available to your package manager

Create your own repository

cd BASE_DIR
dpkg-scanpackages build_area /dev/null | gzip -9c > Packages.gz

Now open/etc/apt/sources.list in your favorite editor, and append the following lines to the bottom (substituting the full path to your repos for /path/to/BASE_DIR/).

# Orocos packages
deb file:///path/to/BASE_DIR/ ./

Open Synaptic, reload, search for orocos and install.

KDL and OCL

Follow the same basic approach first for KDL, then for OCL

  1. build packages
  2. update the repository doing just the "dpkg-scanpackages" line again
  3. install

NB KDL and OCL will happily both build into "build_area" alongside RTT.

Test installed packages

  • 1.x: Build the quicky components. Requires OCL (install at least the

orocos-ocl-gnulinux1.8-bin and liborocos-ocl-gnulinux1.8-dev packages).

# 1.x:
svn co ...
cd quicky
mkdir build && cd build
cmake ..
make
 
# one of the following two exports, depending on your situation
export LD_LIBRARY_PATH=.
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:.
 
deployer-gnulinux -s ../quicky.xml
ls Quicky   # you should see Data_W != 0

  • 2.x: Run 'orocreate-pkg testme' and try to build the testme package.

orocreate-pkg testme
cd testme
 
#non-ROS:
make install
#ROS:
make
 
deployer-gnulinux 
> import("testme")
> displayComponentTypes()

Test CORBA deployer

These instructions test inter-process communication on the same machine. See [2] for more details on running CORBA-based deployers between computers.

In the first shell start the naming service and the deployer

Naming_Service -m 0 -ORBDottedDecimalAddresses 1 -ORBListenEndpoints  iiop://127.0.0.1:2809 -ORBDaemon
export NameServiceIOR=corbaloc:iiop:127.0.0.1:2809/NameService
deployer-corba-gnulinux -s ../quicky.xml -- -ORBDottedDecimalAddresses 1
ls Quicky   # you should see Data_W != 0

In the second shell run the taskbrowser and see the Quicky component running in the deployer

export NameServiceIOR=corbaloc:iiop:127.0.0.1:2809/NameService
ctaskbrowser-gnulinux Deployer -ORBDottedDecimalAddresses 1
ls Quicky   # you should see Data_W != 0

Gotchas

If the v1.8 files have already been committed to the repository, then you don't need the debchange and svn add commands when building the packages.

Make repository available to other machines

See [1] below.

References

[1] http://www.debian.org/doc/manuals/repository-howto/repository-howto#setting-up [2] http://orocos.org/wiki/rtt/frequently-asked-questions-faq/using-corba