Saturday, January 07, 2012

Strongswan 4.6.2dr3 on Ubuntu 12.04 alpha 1

For some reason latest Strongswan version for Ubuntu is still 4.5.1. See below how to compile and package latest 4.6.2dr3. Not pretty, but works for me when testing new version.

# Get latest source tarball
mkdir -p /usr/src/strongswan
cd /usr/src/strongswan

# Install components required for compiling it
apt-get install build-essential devscripts
apt-get build-dep strongswan

# Grab source of old version
apt-get source strongswan

# Do little magic
cd strongswan-4.5.2
uupdate ../strongswan-4.6.2dr3.tar.bz2 -v 4.6.2dr3

# Docs say dpkg-source creates .dsc but that doesn't seem to be true
# so we do it manually.
cd ..
dpkg-source -D"Version=4.6.2dr3-0ubuntu1" -Zbzip2 --before-build strongswan-4.6.2dr3
cat >strongswan_4.6.2dr3-0ubuntu1.dsc << __EOF__
Format: 3.0 (quilt)
Source: strongswan
Binary: strongswan, libstrongswan, strongswan-dbg, strongswan-starter, strongswan-ikev1, strongswan-ikev2, strongswan-nm
Architecture: any
Version: 4.6.2dr3-0ubuntu1
Maintainer: Rene Mayrhofer <>
Standards-Version: 3.9.1
Vcs-Git: git://
Build-Depends: debhelper (>= 7.1), libtool, libgmp3-dev, libssl-dev (>= 0.9.8), libcurl4-openssl-dev | libcurl3-dev | libcurl2-dev, libldap2-dev, libpam0g-dev, libkrb5-dev, bison, flex, bzip2, po-debconf, hardening-wrapper, network-manager-dev (>= 0.7), libfcgi-dev, clearsilver-dev, libxml2-dev, libsqlite3-dev, libnm-glib-vpn-dev (>= 0.7), libnm-util-dev (>= 0.7), gperf, libcap-dev

# disable eap-tnc support (fails to compile on Ubuntu)
# update lib paths
# remove unnecessary patch
sed -i.bak -e 's/enable-eap-tnc/disable-eap-tnc/g' strongswan-4.6.2dr3/debian/rules
sed -i.bak -e 's/usr\/lib\/lib/usr\/lib\/ipsec\/lib/g' \
 -e 's/usr\/lib\/$/usr\/lib\/ipsec\//g' \
sed -i.bak -e 's/usr\/lib\/lib/usr\/lib\/ipsec\/lib/g' \
 -e 's/usr\/lib\/$/usr\/lib\/ipsec\//g' \
echo "usr/lib/ipsec/* usr/lib/ipsec/" >>strongswan-4.6.2dr3/debian/libstrongswan.install
echo "usr/lib/ipsec/* usr/lib/ipsec/" >>strongswan-4.6.2dr3/debian/libstrongswan.install
sed -i.bak -e 's/^0001/#0001/g' strongswan-4.6.2dr3/debian/patches/series

# Compile and package latest version
dpkg-source -D"Version=4.6.2dr3-0ubuntu1" -Zbzip2 --before-build strongswan-4.6.2dr3
cd strongswan-4.6.2dr3
dpkg-buildpackage -us -uc -nc -v4.6.2dr3

# Install new packages
cd ..
dpkg -i \
libstrongswan_4.6.2dr3-0ubuntu1_i386.deb \
strongswan_4.6.2dr3-0ubuntu1_all.deb \
strongswan-dbg_4.6.2dr3-0ubuntu1_i386.deb \
strongswan-ikev1_4.6.2dr3-0ubuntu1_i386.deb \
strongswan-ikev2_4.6.2dr3-0ubuntu1_i386.deb \

No comments:

Post a Comment

Got something to say?!