nixpkgs/pkgs/tools/networking/strongswan/default.nix

88 lines
3.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl
, pkgconfig, autoreconfHook
, gmp, python, iptables, ldns, unbound, openssl, pcsclite
, openresolv
, systemd, pam
, enableTNC ? false, curl, trousers, sqlite, libxml2
, enableNetworkManager ? false, networkmanager
}:
with stdenv.lib;
2014-09-16 20:10:37 +02:00
stdenv.mkDerivation rec {
2016-05-23 14:55:05 +02:00
name = "strongswan-${version}";
strongswan: 5.6.1 -> 5.6.2 Semi-automatic update. These checks were performed: - built on NixOS - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki -h` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki -h` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki --help` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/charon-cmd --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/charon-cmd --version` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/charon-cmd --help` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/ipsec --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/ipsec --version` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/ipsec version` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl -h` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl -h` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl --help` and found version 5.6.2 - found 5.6.2 with grep in /nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2 - found 5.6.2 in filename of file in /nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2
2018-02-28 01:52:27 +01:00
version = "5.6.2";
2014-09-16 20:10:37 +02:00
src = fetchurl {
url = "http://download.strongswan.org/${name}.tar.bz2";
strongswan: 5.6.1 -> 5.6.2 Semi-automatic update. These checks were performed: - built on NixOS - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki -h` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki -h` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/pki --help` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/charon-cmd --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/charon-cmd --version` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/charon-cmd --help` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/ipsec --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/ipsec --version` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/ipsec version` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl -h` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl --help` got 0 exit code - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl -h` and found version 5.6.2 - ran `/nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2/bin/swanctl --help` and found version 5.6.2 - found 5.6.2 with grep in /nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2 - found 5.6.2 in filename of file in /nix/store/jd04xpik9zwmy39nh0axfss0m4hmw8yv-strongswan-5.6.2
2018-02-28 01:52:27 +01:00
sha256 = "14ifqay54brw2b2hbmm517bxw8bs9631d7jm4g139igkxcq0m9p0";
2014-09-16 20:10:37 +02:00
};
dontPatchELF = true;
2017-07-19 23:46:49 +02:00
nativeBuildInputs = [ pkgconfig autoreconfHook ];
2015-08-03 16:59:33 +02:00
buildInputs =
2017-07-19 23:46:49 +02:00
[ gmp python iptables ldns unbound openssl pcsclite ]
++ optionals enableTNC [ curl trousers sqlite libxml2 ]
++ optionals stdenv.isLinux [ systemd.dev pam ]
++ optionals enableNetworkManager [ networkmanager ];
patches = [
2014-12-22 20:55:01 +01:00
./ext_auth-path.patch
./firewall_defaults.patch
2014-12-22 20:55:01 +01:00
./updown-path.patch
];
2014-09-19 07:09:00 +02:00
2015-08-05 12:12:09 +02:00
postPatch = ''
substituteInPlace src/libcharon/plugins/resolve/resolve_handler.c --replace "/sbin/resolvconf" "${openresolv}/sbin/resolvconf"
# swanctl can be configured by files in SWANCTLDIR which defaults to
# $out/etc/swanctl. Since that directory is in the nix store users can't
# modify it. Ideally swanctl accepts a command line option for specifying
# the configuration files. In the absence of that we patch swanctl to look
# for configuration files in /etc/swanctl.
substituteInPlace src/swanctl/swanctl.h --replace "SWANCTLDIR" "\"/etc/swanctl\""
# glibc-2.26 reorganized internal includes
sed '1i#include <stdint.h>' -i src/libstrongswan/utils/utils/memory.h
2015-08-05 12:12:09 +02:00
'';
preConfigure = ''
configureFlagsArray+=("--with-systemdsystemunitdir=$out/etc/systemd/system")
'';
2015-08-03 16:59:33 +02:00
configureFlags =
[ "--enable-swanctl" "--enable-cmd" "--enable-systemd"
2015-08-04 19:16:27 +02:00
"--enable-farp" "--enable-dhcp"
"--enable-openssl"
2015-08-04 19:16:27 +02:00
"--enable-eap-sim" "--enable-eap-sim-file" "--enable-eap-simaka-pseudonym"
"--enable-eap-simaka-reauth" "--enable-eap-identity" "--enable-eap-md5"
"--enable-eap-gtc" "--enable-eap-aka" "--enable-eap-aka-3gpp2"
"--enable-eap-mschapv2" "--enable-eap-radius" "--enable-xauth-eap" "--enable-ext-auth"
2015-08-04 19:16:27 +02:00
"--enable-forecast" "--enable-connmark" "--enable-acert"
2015-09-06 21:05:11 +02:00
"--enable-pkcs11" "--enable-eap-sim-pcsc" "--enable-dnscert" "--enable-unbound"
2017-07-19 23:48:05 +02:00
"--enable-af-alg" "--enable-xauth-pam" "--enable-chapoly" ]
++ optionals stdenv.isx86_64 [ "--enable-aesni" "--enable-rdrand" ]
++ optional (stdenv.system == "i686-linux") "--enable-padlock"
++ optionals enableTNC [
2015-08-03 16:59:33 +02:00
"--disable-gmp" "--disable-aes" "--disable-md5" "--disable-sha1" "--disable-sha2" "--disable-fips-prf"
"--enable-curl"
2015-08-03 16:59:33 +02:00
"--enable-eap-tnc" "--enable-eap-ttls" "--enable-eap-dynamic" "--enable-tnccs-20"
"--enable-tnc-imc" "--enable-imc-os" "--enable-imc-attestation"
"--enable-tnc-imv" "--enable-imv-attestation"
2015-08-04 19:16:27 +02:00
"--enable-tnc-ifmap" "--enable-tnc-imc" "--enable-tnc-imv"
2015-08-03 16:59:33 +02:00
"--with-tss=trousers"
"--enable-aikgen"
"--enable-sqlite" ]
++ optional enableNetworkManager "--enable-nm";
2014-09-16 20:10:37 +02:00
NIX_LDFLAGS = "-lgcc_s" ;
2014-09-16 20:10:37 +02:00
meta = {
description = "OpenSource IPsec-based VPN Solution";
homepage = https://www.strongswan.org;
license = licenses.gpl2Plus;
platforms = platforms.all;
2014-09-16 20:10:37 +02:00
};
}