2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, cmake, openssl, libedit, flex, bison, qt4, makeWrapper
|
2013-12-30 17:17:17 +00:00
|
|
|
, gcc, nettools, iproute, linuxHeaders }:
|
2013-10-18 17:50:21 +01:00
|
|
|
|
|
|
|
# NOTE: use $out/etc/iked.conf as sample configuration and also set: dhcp_file "/etc/iked.dhcp";
|
|
|
|
# launch with "iked -f /etc/iked.conf"
|
|
|
|
|
2013-12-30 17:17:17 +00:00
|
|
|
# NOTE: my testings reveal that kernels 3.11.10 and 3.12.6 won't let the traffic through the tunnel,
|
|
|
|
# so I'm sticking with 3.4
|
|
|
|
|
2013-10-18 17:50:21 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-09-12 20:55:52 +01:00
|
|
|
pname = "ike";
|
|
|
|
version = "2.2.1";
|
2013-10-18 17:50:21 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-09-12 20:55:52 +01:00
|
|
|
url = "https://www.shrew.net/download/ike/${pname}-${version}-release.tgz";
|
2013-10-18 17:50:21 +01:00
|
|
|
sha256 = "0fhyr2psd93b0zf7yfb72q3nqnh65mymgq5jpjcsj9jv5kfr6l8y";
|
|
|
|
};
|
|
|
|
|
2019-09-12 20:55:52 +01:00
|
|
|
patches = [
|
|
|
|
# required for openssl 1.1.x compatibility
|
|
|
|
(fetchpatch {
|
|
|
|
name = "openssl-1.1.0.patch";
|
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/openssl-1.1.0.patch?h=ike&id=3a56735ddc26f750df4720f4baba0728bb4cb458";
|
|
|
|
sha256 = "1hw8q4xy858rivpjkq5288q3mc75d52bg4w3n30y99h05wik0h51";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake flex bison makeWrapper ];
|
|
|
|
buildInputs = [ openssl libedit qt4 nettools iproute ];
|
2013-10-18 17:50:21 +01:00
|
|
|
|
2020-01-06 11:09:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
# fix build with bison3
|
|
|
|
sed -i 's/define "parser_class_name"/define parser_class_name/' source/iked/conf.parse.yy
|
|
|
|
'';
|
|
|
|
|
2013-10-18 17:50:21 +01:00
|
|
|
configurePhase = ''
|
|
|
|
mkdir -p $out/{bin,sbin,lib}
|
2013-12-30 17:17:17 +00:00
|
|
|
cmake -DQTGUI=YES -DETCDIR=$out/etc -DLIBDIR=$out/lib -DSBINDIR=$out/sbin -DBINDIR=$out/bin \
|
|
|
|
-DKRNINC="${linuxHeaders}/include/" -DTESTS=YES \
|
|
|
|
-DMANDIR=$out/man -DNATT=YES -DCMAKE_INSTALL_PREFIX:BOOL=$out
|
2013-10-18 17:50:21 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
make install
|
|
|
|
for file in "$out"/bin/* "$out"/sbin/*; do
|
2021-01-15 13:21:58 +00:00
|
|
|
wrapProgram $file --prefix LD_LIBRARY_PATH ":" "$out/lib:${lib.makeLibraryPath [ openssl gcc.cc stdenv.cc.libc libedit qt4 ]}"
|
2013-10-18 17:50:21 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.shrew.net/software";
|
2013-10-18 17:50:21 +01:00
|
|
|
description = "IPsec Client for FreeBSD, NetBSD and many Linux based operating systems";
|
|
|
|
platforms = platforms.unix;
|
2016-05-17 12:57:28 +01:00
|
|
|
maintainers = [ maintainers.domenkozar ];
|
2014-03-25 00:58:36 +00:00
|
|
|
license = licenses.sleepycat;
|
2013-10-18 17:50:21 +01:00
|
|
|
};
|
|
|
|
}
|