building_strongswan - acis-acheron/acheron GitHub Wiki

Building strongSwan

This is a guide to building and installing Contrail's fork of strongSwan with their JSON RPC named Styx on a Debian Squeeze machine.

Strongswan with Styx

First, ensure that you have Subversion installed (aptitude install subversion as root, otherwise). Then run

svn checkout svn://svn.forge.objectweb.org/svnroot/contrail/trunk/resource/strongswan strongswan_styx

to check the repository out into strongswan_styx.

strongSwan Dependencies

Running aptitude build-dep libstrongswan will install all the needed "-dev" packages on your system. For your convenience, these are

libtool libgmp3-dev libsoup2.4-dev bison flex gperf libreadline-dev

Styx Dependencies

Note that Styx needs libjansson, the packages for which are only available in Debian Wheezy (7.0) and up, thus we must install backports when using Squeeze.

Apt Pinning

Debian offers a "backports" service. This offers newer packages, modified to minimize the number of newer dependencies. libjansson-dev is available from squeeze-backports.

You'll first need to add the backports source to either /etc/apt/sources.list or to a new file in /etc/apt/sources.list.d/ (the more modern recommended "Debian way" of doing things). This is easy as:

echo "deb http://backports.debian.org/debian-backports " \
     "squeeze-backports main contrib non-free" > \
     /etc/apt/sources.list.d/backports.list

You may also wish to add a deb-src line to the file (not required):

echo "deb-src http://backports.debian.org/debian-backports " \
     "squeeze-backports main contrib non-free" >> \
     /etc/apt/sources.list.d/backports.list

We're only half done at this point. Before running aptitude update and messing up our system with all these new packages, we must tell aptitude what repository to prefer (i.e., stable over backports). Default pin priority is "500". A lower priority is given less preference. Let's give backports a priority of 100, writing:

Package: *
Pin: release a=backports
Pin-Priority: 100

to /etc/apt/preferences.d/backports. Now we can finally run aptitude update, followed by aptitude install libjansson-dev.

Building

strongSwan has a pretty sensible build system:

aptitude install build-essential automake # don't laugh!
./autogen.sh
./configure --enable-styx
make
make install # as root

As an alternative to running make install straight (might make things difficult to uninstall in the future), consider a chroot or using checkinstall:

...
make
checkinstall # as root