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
wget http://download.strongswan.org/strongswan-4.6.2dr3.tar.bz2

# 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 <rmayr@debian.org>
Homepage: http://www.strongswan.org
Standards-Version: 3.9.1
Vcs-Browser: http://anonscm.debian.org/git/pkg-swn/strongswan.git
Vcs-Git: git://anonscm.debian.org/pkg-swan/strongswan.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
__EOF__

# 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' \
 strongswan-4.6.2dr3/debian/libstrongswan.install
sed -i.bak -e 's/usr\/lib\/lib/usr\/lib\/ipsec\/lib/g' \
 -e 's/usr\/lib\/$/usr\/lib\/ipsec\//g' \
 strongswan-4.6.2dr3/debian/strongswan-ikev2.install
echo "usr/lib/ipsec/libtls.so* usr/lib/ipsec/" >>strongswan-4.6.2dr3/debian/libstrongswan.install
echo "usr/lib/ipsec/libsimaka.so* 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 \
strongswan-starter_4.6.2dr3-0ubuntu1_i386.deb



Comments