]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - strongswan/strongswan.nm
setup: Drop /etc/environment
[ipfire-3.x.git] / strongswan / strongswan.nm
index 08f3cc3a63d28840f8fc0efe06e47c6dc643a03f..bd5e696b074a84805391c40831bb978d495ce6e8 100644 (file)
@@ -4,13 +4,13 @@
 ###############################################################################
 
 name       = strongswan
-version    = 4.6.2
+version    = 5.7.2
 release    = 1
 
 groups     = Networking/VPN
 url        = http://www.strongswan.org/
 license    = GPL
-summary    = IPsec and IKEv1 implementation for Linux 2.4 and 2.6 kernels.
+summary    = IPsec (IKEv1 + IKEv2) implementation for Linux.
 
 description
        StrongSwan is a complete IPsec and IKEv1 implementation for
@@ -20,49 +20,109 @@ description
 end
 
 source_dl  = http://download.strongswan.org/
+sources    = %{thisapp}.tar.bz2
 
 build
        requires
+               autoconf
+               automake
                bison
                flex
                gmp-devel
                gperf
+               ldns-devel
                libcap-devel
                libcurl-devel
                libgcrypt-devel
+               libtool
                openldap-devel
+               openssl-devel
                perl
                sqlite-devel
+               systemd-devel >= 221-2
+               unbound-devel >= 1.7
        end
 
        configure_options += \
-               --sysconfdir=/etc \
-               --libexecdir=/usr/lib \
-               --with-user=nobody \
-               --with-group=nobody \
+               --disable-static \
+               --with-ipseclibdir=%{libdir}/ipsec \
                --enable-curl \
                --enable-ldap \
+               --enable-openssl \
                --enable-sqlite \
                --enable-gcrypt \
-               --enable-padlock \
-               --enable-cisco-quirks \
-               --with-capabilities=libcap
+               --enable-ccm \
+               --enable-ctr \
+               --enable-gcm \
+               --enable-chapoly \
+               --enable-unity \
+               --enable-xauth-eap \
+               --enable-xauth-noauth \
+               --enable-eap-radius \
+               --enable-eap-tls \
+               --enable-eap-ttls \
+               --enable-eap-peap \
+               --enable-eap-mschapv2 \
+               --enable-eap-identity \
+               --disable-blowfish \
+               --disable-rc2 \
+               --with-capabilities=libcap \
+               --enable-unbound \
+               --enable-systemd \
+               --disable-charon \
+               --disable-stroke \
+               --disable-scepclient
 
-       test
-               make check
+       if "%{DISTRO_ARCH}" == "i686"
+               configure_options += --enable-padlock
        end
-end
 
-# Plugins and many other files are installed in /usr/lib/ipsec
-# and loaded by using a RPATH.
-quality-agent
-       whitelist_rpath
-               /usr/lib/ipsec
+       # The testsuite does not run through in the build system
+       # on ARM systems.
+       #test
+       #       make check
+       #end
+
+       install_cmds
+               mv -v %{BUILDROOT}%{unitdir}/strongswan{-swanctl,}.service
+
+               # Install network settings
+               install -v -m 644 %{DIR_SOURCE}/network.conf \
+                       %{BUILDROOT}%{sysconfdir}/strongswan.d/
+
+               # Create directory for connections
+               mkdir -pv %{BUILDROOT}%{sysconfdir}/swanctl/connections
+               echo "include connections/*.conf" > \
+                       %{BUILDROOT}%{sysconfdir}/swanctl/swanctl.conf
+
+               # Drop unneeded files.
+               rm -rvf %{BUILDROOT}%{libdir}/ipsec/lib*.so
+
+               # Move libraries to libdir.
+               mv %{BUILDROOT}%{libdir}/ipsec/lib*.so.* %{BUILDROOT}%{libdir}
        end
 end
 
 packages
        package %{name}
+               script postin
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl reload-or-try-restart strongswan.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       systemctl disable --no-reload strongswan.service >/dev/null 2>&1 || :
+                       systemctl stop strongswan.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+       end
 
        package %{name}-debuginfo
                template DEBUGINFO